Ask coding questions

← Back to all posts
Can I use selenium?
_5

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

Voters
donmazyusuf
hellobyehi2000
CarlosAlbertoSS
Elkakaneti
DimitryZub1
indentErr
AppleVenturer
rmmm1
Comfyish
marcottleong
Comments
hotnewtop
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")

much0hackerBOI

@ShmuelM Awesome

TechTale

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

LenceOfTheOrder

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

AppleVenturer

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

dayeongbusiness

@ShmuelM Thanks. from south Korea :)

amasad

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

rediar

@amasad awesome!

much0hackerBOI

@amasad For me its says: 404 NOT_FOUND

much0hackerBOI

for me it says: 404 NOT_FOUND

divyanshupariha

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

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.

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.