2017-12-31 38 views
-1

셀레늄에서 파이어 폭스 세션을 만드는 중 오류가 발생했습니다. 셀레늄을 처음 사용하는 firefox 세션을 시작하려면이 오류를 해결하는 데 도움이되도록 제발 셀레늄 라이브러리를 처음 사용합니다.

이것은 지금까지 제 코드입니다.

from selenium import webdriver 
from selenium.webdriver.common.keys import Keys 

# create a new Firefox session 
driver = webdriver.Firefox() 

및 오류 발생하는이 도와주세요

Traceback (most recent call last): 
    File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start 
    stdout=self.log_file, stderr=self.log_file) 
    File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 707, in __init__ 
    restore_signals, start_new_session) 
    File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 990, 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 "A:\python\webscrapping\seltry.py", line 5, in <module> 
    driver = webdriver.Firefox() 
    File "C:\Users\yash\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 148, in __init__ 
    self.service.start() 
    File "C:\Users\yash\AppData\Local\Programs\Python\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. 

입니다!

+0

[Selenium with Python - Geckodriver 실행 파일이 PATH에 있어야 함] (https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in- 경로) – JeffC

+0

[selenium.common.exceptions.WebDriverException의 가능한 복제본 : 메시지 : 'chromedriver'실행 파일이 PATH 오류가 있어야합니다.] (https://stackoverflow.com/questions/46085270/selenium-common-exceptions-webdriverexception -message-chromedriver-executabl) – DebanjanB

답변

0

오류 : selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 거의 이것에 대해 설명합니다. 당신은이 튜토리얼을 따라갈 수 있습니다 Selenium using Python - Geckodriver executable needs to be in PATH

그리고 내가 생각하기에 질문을하기 전에 귀하의 질문을 연구하십시오.

+0

이것은 중복 된 것이므로 답장 대신에 표시를하여 많은 수의 dup으로 끝내지 않고 정리할 것입니다. – JeffC

관련 문제