Forums

Difficulty Setting up Selenium with PhantomJS

a

did u by any chance save a requirements.txt from your old virtualenv? if so you could reinstall from that file.

also another thing to check- were you using python3.4 previously?

thanks for your response, bfg. we didn't save a requirements.txt unfortunately and we were using python3.4 previously. any other idea why it might be breaking?

wait a second. phantomjs.exe? Isn't this a windows executable?

Yeah, it is a windows executable. Should it be something else? We have the executables (chromedriver.exe, geckodriver.exe, and phantomjs.exe) in a folder in our github repo and we just pull the github repo. We've also tried manually uploading the executables. Since this is the same thing we did when it worked a couple weeks ago, we didn't think it would be a problem.

pythonanywhere is a linux platform, so the windows executable won't work. not sure why it ever worked a couple weeks ago.

See here. Seems like you should use virtualdisplay + firefox instead

Hmm ok thanks, we'll try that out! Just curious, would phantomjs built for a linux platform work?

I think there are some permission issues that make it so that it won't run on PythonAnywhere regardless. (but on your own local linux machine it could work)

so pythonanywhere only works with firefox?

Yes

did it work? I'm new here, how do i use selenium with firefox? driver = webdriver.Firefox() im doing this also tried the pyvirtualdisplay. didnt work . plesae help asap

selenium.common.exceptions.WebDriverException: Message: 'geckodriver.exe' executable may have wrong permissions.

THIS IS WHAT IT SAYS FINALLY

i also tried with the linux geckodriver, didnt work!

Which version of Python are you using? I think there might be some problems with 3.6. Other versions should work fine if you follow the instructions on this help page.