Using Selenium and chrome driver or gecko driver to do browser automations

I’m trying to use Selenium to make a bot that opens the twitter web page, and logs in to post a single tweet bypassing the api. It works fine on my local computer with chrome driver, but I can’t get it to work with chrome driver or with gecko driver on replit. Does replit not support any kind of headless browser like this?

What errors? Please provide more information.

3 Likes

https://replit.com/@dypcycz76k/ExpertInbornSpecialist?v=1#main.py

[selenium.common.exceptions.WebDriverException: Message: Service /home/runner/.wdm/drivers/chromedriver/linux64/111.0.5563/chromedriver unexpectedly exited. Status code was: 127

(127 = command not found)


Try after you add chromedriver via Nix: in Shell:

sed -i 's/];/  pkgs.chromedriver\n  &/' replit.nix
2 Likes