Home > front end >  selenium .get method fails to load a link
selenium .get method fails to load a link

Time:03-10

so I have started working on selenium, and this is my first time working with it, the code provided below opens chrome but doesnt open the url mentioned in the .get function.

from selenium import webdriver
import time

# open chrome and access the page
driver = webdriver.Chrome("C:\Program Files\Google\Chrome\Application\chrome.exe")
driver.get('https://dex.onxrp.com/?project=XREEFS')
time.sleep(5)
driver.close()

I have installed the selenium pip library, do i need something else as well for it to load the link?

CodePudding user response:

Using the default argument which can be passed within webdriver.Chrome() is the value of the KEY executable_path i.e. the logical/absolute path of the ChromeDriver executable but not of executable.


Solution

Ideally, your line of code will be:

driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe')
  • Related