Skip to content
← Back to Community
Can I use selenium?
Profile icon
_5

Is it possible to use selenium? I keep getting errors asking to put driver into the PATH

Voters
Profile icon
Kruffer
Profile icon
MBullaro29025
Profile icon
sstiglitzstrike
Profile icon
SHAHBAZSHAH
Profile icon
cbse
Profile icon
CoopCodes
Profile icon
peddah
Profile icon
ZahidurRahman1
Profile icon
Ishan99
Profile icon
Jkrox
Comments
hotnewtop
Profile icon
CoopCodes

Hey I know there is a solution to this question, however it doesn't work for some people, including me. I found an answer:

Hey for anyone having problems with the webdriver not being found, here is the solution:

It took a while to find out, what you need to do is create a new repl, and press on the 3 dots and unhide hidden files (it says unhide because i have mine unhidden):

Annotation 2022-02-26 090201
Once you've done this, press on the replit.nix file.
You should see the following code:

image

Once you've done this, inside the list named 'deps' you add pkgs.chromium & pkgs.chromedriver, as shown:
Annotation 2022-02-26 090615
Once this is done you can run any selenium script inside the repl, hope this helps!

Profile icon
MathEnthusiasPi

@CoopCodes Thank you so much! This was what I needed!

Profile icon
RubenJimenez8

@CoopCodes Thank you!!!! You can't imagine the amount of time I've spent trying to do this. Thanks from the heart

Profile icon
ShmuelM

The main trick is setting the options correctly
This is how you do it (see comments below for the source):

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

driver = webdriver.Chrome(options=chrome_options)
driver.get("https://youtube.com")

Profile icon
much0hackerBOI

@ShmuelM Awesome

Profile icon
TechTale

@ShmuelM Thanks a lot .First time I launched it did not work second try without modify anything it worked.

Profile icon
LenceOfTheOrder

@ShmuelM Your solution worked on the first try! Thank you so much!

Profile icon
AppleVenturer

Amazing! Had been searching for this for quite some time. @ShmuelM

Profile icon
dayeongbusiness

@ShmuelM Thanks. from south Korea :)

Profile icon
AidanOBrien8

@ShmuelM only problem is it opens chromium instead of google chrome

Profile icon
Ishan99

@ShmuelM #Thank you so much,
For the first I lost hope, but luckily found your comment on replit itself

Profile icon
amasad

Hey, selenium works now. See the first comment here https://repl.it/bugs/p/python-3-selenium

Profile icon
rediar

@amasad awesome!

Profile icon
much0hackerBOI

@amasad For me its says: 404 NOT_FOUND

Profile icon
much0hackerBOI

for me it says: 404 NOT_FOUND

Profile icon
divyanshupariha

@amasad One of the best thing in repl is for me as am automator

Profile icon
a5rocks

Okay, so you know what the $PATH environment variable is, right? Basically it stores a bunch of folders that your os checks through, for example, to find python.exe, because you ran python. So, your program is like : Hey, we can't find your webdriver (the thing that renders HTML and JS) anywhere! Make sure to add it to your PATH so we can find it

As for if you can use it, you might be able to. Just edit the path environment variable and follow the setup guides.

Profile icon
MP7

@a5rockshe so the repl.it interpreter pulls the file from our computer? I thought repl.it has its own database of files/folders/libraries on the server that it imports/uploads from. Not the case?

My attempts to point the interpreter to the webdriver (chrome) I have installed on my computer have been unsuccessful.

Profile icon
lolindihome01

@a5rocks So.. how to add path in Repl.it ?

Profile icon
a5rocks

@lolindihome01 I would recommend checking other comments here, as this is out of date I believe (as in there's better ways now)