1

I imported selenium modules in python file but when i run this code I got

Traceback (most recent call last): 
File "koovs.py", line 4, in <module>
  browser=webdriver.Firefox()
File "C:\Users\hp\Anaconda2\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in __init__
  self.service.start()
File "C:\Users\hp\Anaconda2\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 AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of
<selenium.webdriver.firefox.service.Service object at 0x0000000003228400>> ignored

What i have to do. My code is

from selenium import webdriver
from bs4 import BeautifulSoup
browser=webdriver.Firefox()
browser.get('http://www.koovs.com/women/dresses/sortby-discount-high/')
soup=BeautifulSoup(browser.page_source)
3
  • 2
    you should paste the error as text instead of image. Commented Jan 3, 2017 at 5:13
  • I think that error image is not correct for your question. Commented Jan 3, 2017 at 5:20
  • Can you confirm what OS you're on and/or VM setup? And that Firefox is installed and the executable is in your PATH? I assume you're on Windows. Maybe check out this answer stackoverflow.com/a/17582010/823942 to see if you leads you down the right path. Commented Jan 3, 2017 at 6:14

2 Answers 2

1

Did you install geckodriver?

To use Firefox webdriver, You must install geckodriver. And put the binary file into folder which can be accessed by system PATH.

Sign up to request clarification or add additional context in comments.

Comments

0

Go to the link and download geckodriver based on your windows 32 or 64 bit.

Extract the geckodriver.exe to your computer and add the corresponding path to Environmental variables.

For Example: if you extracted the geckodriver.exe to Desktop, you should add desktop path to Path Env. variable.

Then re-execute your code. Sometimes env. var don't reflect. In this case, you might need to restart your IDE (like Eclipse).

Hope it helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.