Apologies if this is a very basic error. But when changing the client parameter to anything other than "remote"(eg. "firefox"), I get an error informing that Geckodriver is not in the path.
Traceback (most recent call last):
File "sample/remotecopy.py", line 18, in
driver = WhatsAPIDriver(client='firefox', username='API', proxy=None, command_executor=None, loadstyles=False, profile=None, headless=False, autoconnect=True, logger=None, extra_params=None, chrome_options=None)
File "/usr/local/lib/python2.7/site-packages/webwhatsapi/__init__.py", line 196, in __init__
self.driver = webdriver.Firefox(capabilities=capabilities, options=options, extra_params)
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 157, in __init__
self.service.start()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: **Message: 'geckodriver' executable needs to be in PATH.
It is in my local servers' system path, but I assume the error is occurring because it is not in the docker containers path? How do I add it?
Thanks
the command_executor=None could not be none
see the example line 18 driver = WhatsAPIDriver(profile=profiledir, client='remote', command_executor=os.environ["SELENIUM"])
you can set the os environment after line 6: os.environ['SELENIUM'] = "http://IP:4444/wd/hub" (the IP address where selenium server is running)
you can set the os environment after line 6:
os.environ['SELENIUM'] = "http://IP:4444/wd/hub"(the IP address where selenium server is running)
Thanks, this solved the Geckodriver issue.
But according to the documentation:
"command_executor: Passed directly as an argument to Remote Selenium. Ignore if not using it."
My understanding is that command_executor is not required if running a Firefox client, correct? Could you give an example of line 18 with a Firefox client? Thanks.
are you using remote or local selenium ?
Oh right, I see. Yeah, I followed the readme so it would seem I am using the remote Selenium.
Sorry, this is turning into another issue. But If you wouldn't mind, I have a question. Where does the instance of Firefox run? Or where can I view the QR code? I have tried to view it using RealVNC but it refuses because my password is incorrect. I've also tried using the get_qr() function mentioned in the docs but I can't seem to save it somewhere that I can view. Does it save to the docker container or to my local disk? Thanks
The QR code will be saved to the same folder of sample/remotecopy.py with get_qr().
If you want to use firefox, download the latest version of geckodriver according to your OS from here and place it on the same location sample.
Closed due to inactivity and no reply to solution
Most helpful comment
The QR code will be saved to the same folder of
sample/remotecopy.pywith get_qr().If you want to use firefox, download the latest version of geckodriver according to your OS from here and place it on the same location
sample.