Python Forum

Full Version: Help: Beautiful Soup - Parsing HTML table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am trying to get a table from this link:
https://www.wunderground.com/history/dai...e/2018-6-1

And the table I am trying to get data about is the "Daily Observations" table.

No matter what I do, I simply can't get any data relevant to that. I've tried...

page_soup = soup(page,'html.parser')
data = page_soup.findAll("table",{"class":"mat-table cdk-table mat-sort ng-star-inserted"})
print(data)
As well as several other findAll() attributes and keep getting an empty list returned.

Help is greatly appreciated. Thanks!
there must be more code than this.
show it all.
finding the table is just the start, now you need to parse what you have found.
Suggest taking the web scraping tutorials part 1 and 2 on this site in the tutorials forum.
That site us JavaScript heavily,so use Selenium.
Here a example there are may more here if you search forum.

Also if give browser.page_source to Pandas to pandas.read_html,it will pull out whole table without doing any parsing.