Selenium webdriver error

Trying to start using Watir in Replit but keep getting Chromedriver-related errors:

unable to connect to /home/runner/.cache/selenium/chromedriver/linux64/110.0.5481.77/chromedriver 127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError)

Repl:

replit.com/@kacper7777777/sandbox-1

What’s the best approach to using Selenium inside Replit?

Hey @kacper7777777,

are you trying to set up a proxy with the purpose of circumventing any firewall or other access control measure?

1 Like

No, just creating a simple scraper to get data from a website. Used google just as an example in my code.

1 Like

You have to include these two packages in the replit.nix file

pkgs.chromium
pkgs.chromedriver

You can find this file by hitting the three little dots at the top of the file tree and showing hidden files.

Should look something like this:

3 Likes

^^ That is python not ruby, but the .nix file should be the same, you’ll just have some ruby packages instead of pkgs.python38Full

2 Likes

Thanks, added the 2 packages you mentioned but now I’m getting this error:

`create_bridge': unknown keyword: :desired_capabilities (ArgumentError)

and the script keeps going in a loop.

I’m not using any capabilities/options so that’s weird.

I have no idea what that could be, it might be something in your code. Can you link your repl

1 Like

Sure, it’s https://replit.com/@kacper7777777/sandbox-1

It looks like the issue is coming from the package watir as it’s trying to use a deprecated selenium method

So what do you suggest doing?

check the package and see if it has any updates, if not you can try using selenium directly as watir is just a wrapper