使用selenium提取表数据的Python Web抓取

时间:2017-02-17 15:08:02

标签: python selenium

我正在尝试用PYTHON selenium网站抓取这个网站。

www.shareinvestor.com/fundamental/factsheet.html?counter=Z74.SI

但是硒似乎悬挂而没有加载。

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver as web 
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)

import time

driver.get("http://www.shareinvestor.com/fundamental/factsheet.html?counter=Z74.SI")
WebDriverWait(driver, 20)
time.sleep(5)
print(driver.page_source)

我对表格感兴趣,如下所示。 我的代码出了什么问题?我无法获得任何输出。

INTERESTED IN THIS TABLE

0 个答案:

没有答案