Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

Selenium using python in mac-I am getting following error

I have set the path in .bashrc as: PATH="/Users/ddd/Downloads/geckodriver:$PATH" export PATH

Still I am unable to run simple script can any1 help me...

Traceback (most recent call last): File "helloselenium.py", line 2, in driver = webdriver.Firefox(executable_path=r'UsersdddDownloadsgeckodriver.exe') File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 144, in init self.service.start() File "/Library/Python/2.7/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: 'UsersdddDownloadsgeckodriver.exe' executable needs to be in PATH.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try pasting geckodriver in ‘/usr/local/bin’

Pass the path, driver = webdriver.Firefox(path=‘/usr/local/bin/geckodriver’)

Then open terminal type in geckodriver if you see it start,it should also launch Firefox via Selenium


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...