mardi 17 juillet 2018

cant find class in HTML

im learning web crawling and i stubmled upon a problem, which is HTML related(i guess)

so i found this freelance project as learning material

so i have to find 'shop name', 'adress' and so on... of these 24 pawnbrokers

my problem is i cant locate all the shops in HTML...

content = page_soup.findAll("div", {"class":"list list-unstyled"})

.......

from urllib.request import urlopen
from bs4 import BeautifulSoup as soup

my_url = 'https://www.thenpa.com/Find-A-Pawnbroker.aspx'
#opening up the connection, grabbing the page
uClient = urlopen(my_url)
#offloads the content
page_html = uClient.read()

uClient.close()
#html parsing
page_soup = soup(page_html, "html.parser")
#grabs each pawnbroker
content = page_soup.findAll("div", {"class":"list list-unstyled"})

makes sense that it should be

<div class=fab-loc-list"> == $0

enter image description here

but its not




Aucun commentaire:

Enregistrer un commentaire