skip to Main Content

Not getting the data from web page with Selenium (Python) – Html

I'm trying to get a table from a dynamic webpage using selenium but it's giving me issues. This is the Python code: from selenium import webdriver url = 'https://draft.shgn.com/nfc/public/dp/788/grid' driver = webdriver.Chrome('C:chromedriver_win32chromedriver.exe') global_dynamicUrl = "https://draft.shgn.com/nfc/public/dp/788/grid" driver.get(global_dynamicUrl) table_area = driver.find_element("xpath", '//*[@id="result"]/table')…

VIEW QUESTION

The result of the xpath expression "html/body/div/text()[1]" is: [object Text]. It should be an element error printing element text using Selenium

I'm attempting to extract "479" from this sample HTML: <div data-testid="testid"> "479" " Miles Away" </div> I'm using the following Selenium code in Python: xpath = 'html/body/div/text()[1]' WebDriverWait(driver, 30).until(EC.visibility_of_element_located((By.XPATH, xpath))) distance = driver.find_element(By.XPATH, xpath) print(distance) Which returns the following error:…

VIEW QUESTION
Back To Top
Search