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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -