I am attempting to scrape a table of stats from mlb.com but need to click a button to expand the stats. When running my code, it appears that the button is hovered over, but nothing seems to actually click it and change the table. How can I expand the table to scrape the data?
Below is the code I have, slimmed down to isolate my problem.
driver = webdriver.Chrome('/home/wsb/Downloads/chromedriver',options = options)
wait = WebDriverWait(driver, 30)
url_mlbcom_h = 'https://www.mlb.com/stats/team'
driver.get(url_mlbcom_h)
button = wait.until(EC.visibility_of_element_located((By.XPATH, '//*[@id="stats-app-root"]/section/section/div[1]/div[2]/div/div[1]/div/div[2]/button'))).click()