Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';使用selenium查找javascript元素(?)_Javascript_Python 3.x_Selenium_Web Scraping - Fatal编程技术网

Can';使用selenium查找javascript元素(?)

Can';使用selenium查找javascript元素(?),javascript,python-3.x,selenium,web-scraping,Javascript,Python 3.x,Selenium,Web Scraping,我试图刮取的页面(为了练习)是下面的url。我正试图把这一页底部的损益表(图表)擦掉 import time from selenium import webdriver from selenium.common.exceptions import NoSuchElementException browser = webdriver.PhantomJS() url = 'https://seekingalpha.com/symbol/CYTR/financials/income-statemen

我试图刮取的页面(为了练习)是下面的
url
。我正试图把这一页底部的损益表(图表)擦掉

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)
我试过各种方法,但都找不到元素

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
我知道我收到页面信息是因为 “browser.find_elements_by_id('div')”返回元素列表


下面是我查看html时的外观

请看一看以感谢您<代码>浏览器。隐式等待(10)似乎正在工作。要测试更多=)