I am trying to scrape data from this webpage:
https://www.premierleague.com/players/4330/player/stats?co=1&se=79
Specifically the four middle numbers (appearances, clean sheets,...) for each season separately (see the dropdown). However, so far I only get the numbers aggregate for all seasons. I use selenium, because beautifulsoup alone could not do it, but selenium does not seem do it either. This is the relevant part of the code (it is in for loop, taking urls from a csv file):
browser = webdriver.Chrome('C:\chromedriver.exe')
browser.get('https://www.premierleague.com/players/4330/player/stats?co=1&se=79')
wait = WebDriverWait(browser, 10)
wait.until(
EC.element_to_be_clickable(
(By.XPATH, "//*[@role='button'][text()='2017/18']")))
html = browser.page_source
soup = bs(html, 'lxml')
Printed tree only has the "all seasons" numbers, although the loaded page in chrome shows only 2017/2018 season. Does anybody has the idea why? The scraping visibly happens after the dropdown is loaded, but it still gives the values relevant before it is loaded.
The dropdown looks like this: