在抓取网页时丢失数据

时间:2017-02-07 16:19:24

标签: python web screen-scraping

我是一名新的Python用户,并且一直试图从food network website抓取数据。

enter image description here

当我使用请求和美味汤时,此部分完全是空的。我该怎么做才能将评级数据读入Python。

我尝试使用硒 我收到以下错误。我确实将驱动程序位置添加到PATH变量:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 990, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last):
  File "proposal_fn.py", line 2, in <module>
    browser = webdriver.Firefox()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in __in
it__
    self.service.start()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x0348B710>
>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 173, in __del__
    self.stop()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 145, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process'

0 个答案:

没有答案