python 3.x - Web Scraping Location Data with BeautifulSoup -


i trying scrape webpage address data (the highlighted street address shown in image:1) using find() function of beautifulsoup library. online tutorials provide examples data can pinpointed class; however, particular site, street address element within larger class="datacol col02 inlineeditwrite" , i'm not sure how @ find() function.

what arguments find() street address in example? appreciated. image: 1

this should started, find div element class "datacol col02 inlineeditwrite" search td elements within , print first td elements text:

divtag = soup.find("div", {"class":"datacol col02 inlineeditwrite"}) tag in divtag:     tdtags = tag.find_all("td")     print (tdtags[0].text) 

the above example assumes want print first td element div elements class "datacol col02 inlineeditwrite" otherwise

divtag = soup.find("div", {"class":"datacol col02 inlineeditwrite"}) tdtags = divtag[0].find_all("td") print (tdtags[0].text) 

Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -