I am trying to scrape Steams hard- and software survey for December 2020 (the table at the bottom of the page). The table is expandable by clicking on one of the parents (e.g. "OS Version"). My goal is to access the tables within these parents.
https://store.steampowered.com/hwsurvey#main_stats
So far I have tried to retrieve this information with requests
and BeautifulSoup
(with different parsers) but Beautifulsoup
always returns an TypeError: 'NoneType' object is not callable
. After searching unsuccessfully for an API, I tried Selenium
in combination with pd.read_html()
. With this approach I was able to access at least the y-labels from the charts above the table but not the desired table below:
import pandas as pd
from selenium import webdriver
url = "https://store.steampowered.com/hwsurvey#main_stats"
opt = webdriver.FirefoxOptions()
opt.add_argument('-headless')
driver = webdriver.Firefox(options=opt)
driver.get(url)
pd.read_html(driver.page_source)
I am appreciative of any suggestion that may help me to overcome this problem.
question from:https://stackoverflow.com/questions/65835743/scraping-onclick-tables-in-python