S
S
stamdyscias2016-10-27 21:35:56
Python
stamdyscias, 2016-10-27 21:35:56

How to install selenium in python?

I installed selenium using pip install selenium, installed firebag, firepath, installed the server on java, downloaded the geckodriver driver, and pointed the path to it in path D:\Work\geckodriver.exe but still this Traceback error is displayed (most recent call last):
File "C:\Users\HP\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\HP\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "C:\ Users\HP\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Cannot find the specified file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/HP/Desktop/ttt.py", line 3, in
driver = webdriver.Firefox()
File "C:\Users\HP\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__
self.service.start()
File "C:\Users\HP\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 71, 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: >
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py" , line 163, in __del__
self.stop()
File "C:\Users\HP\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'
when trying to run a simple script

from selenium import webdriver

driver = webdriver.Firefox()

driver.get("http://www.google.by")

driver.quit()

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeniy _, 2016-10-28
@stamdyscias

In PATH, you need to write the path to the folder in which the .exe is located. those. "D:\Work\".
PS: do not use Cyrillic in the paths. Nowhere and never!

S
Sergey, 2016-10-27
@ktulu

There are problems with Firefox and Selenium.
The latest version of Firefox that works with Selenium is 47.0.1 if I'm not mistaken.

A
Andy_U, 2016-10-27
@Andy_U

See my answer here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question