Ask coding questions

← Back to all posts
Can I use selenium?
_5 (11)

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

Comments
hotnewtop
ShmuelM (9)

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")

TechTale (0)

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

LenceOfTheOrder (0)

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

AppleVenturer (0)

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

amasad (3437)

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

much0hackerBOI (3)

@amasad For me its says: 404 NOT_FOUND

much0hackerBOI (3)

for me it says: 404 NOT_FOUND

divyanshupariha (0)

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

a5rocks (828)

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.

MP7 (21)

@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.