0

The page I'm trying to scrape (for practice) is the url below. I'm trying to scrape the income-statement (chart) on the bottom of the page

import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
browser = webdriver.PhantomJS()
url = 'https://seekingalpha.com/symbol/CYTR/financials/income-statement'



browser.get(url)
time.sleep(7)

I've tried the various methods but it's not locating the element.

browser.find_element_by_xpath("//*[@id='industrial-income-statement']")
#copied the xpath via chrome

browser.find_element_by_xpath('//*[@id="financial-data"]')
#returns error


browser.find_elements_by_id("financial-data")
# returns an empty list

browser.find_element_by_id("industrial-income-statement")
#can't find error

I know I'm receiving the page info because 'browser.find_elements_by_id('div')' returns a list of elements.

Here is how the html looks when I inspectenter image description here

Moondra
  • 4,399
  • 9
  • 46
  • 104
  • 1
    take a look to [Implicit and Explicit Waits](https://stackoverflow.com/questions/10941184/equivalent-of-waitforvisible-waitforelementpresent-in-selenium-webdriver-tests-u) – gaetanoM Jun 05 '17 at 18:00
  • 1
    Thank you. `browser.implicitly_wait(10)` seems to be working. Going to test some more =) – Moondra Jun 05 '17 at 18:08

0 Answers0