小编Aut*_*Job的帖子

selenium不适用于Firefox或Chrome

我正在尝试学习python web scraping,但我不能让selenium与任何一个浏览器一起工作.

from selenium import webdriver
browser = webdriver.Firefox()
Run Code Online (Sandbox Code Playgroud)

这是我的所有代码,我得到了一个错误.

Traceback (most recent call last):
  File "C:\Users\tjhall\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 64, in start
    stdout=self.log_file, stderr=self.log_file)
  File "C:\Users\tjhall\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "C:\Users\tjhall\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1220, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "H:\codingpractice\python\python challenge.com.py", line 2, in <module>
    browser = webdriver.Firefox()
  File "C:\Users\tjhall\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__
    self.service.start() …
Run Code Online (Sandbox Code Playgroud)

python firefox selenium

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

firefox ×1

python ×1

selenium ×1