Skip to content Skip to sidebar Skip to footer

Selenium, Trouble With The Section Tag

I have been trying to scrape the website Fanduel, but I have had been having trouble with the 'section' tag. I want to access the data for each player. Here is my code so far: from

Solution 1:

Required content seem to be dynamically generated, so you might need to wait until JavaScript code executed.

Try to use below code and let me know the result:

from selenium.webdriver.common.byimportByfrom selenium.webdriver.supportimport expected_conditions asECfrom selenium.webdriver.support.uiimportWebDriverWaitas wait
from selenium import webdriver
from pandas.io.htmlimport read_html

driver = webdriver.Firefox()
driver.get(https://www.fanduel.co.uk/fixtures/211/lineups/create?contestId=211-4550213')

table = wait(driver, 10).until(EC.presence_of_element_located((By.XPATH, '//section[contains(@class,"lineup__main")]')))

This should allow you to find target section just right after it's generated and present in DOM

Post a Comment for "Selenium, Trouble With The Section Tag"