Open/Get URL using Selenium
Open or Get URL
To open a given URL in the browser window using Selenium for Python, call get() method on the driver object and pass the URL as argument to get() method.
driver.get('/')
Example
- Initialise Chrome Web Driver object as
driver
. - Get the URL
/
using webdriver
object.
Python Program
from selenium.webdriver.chrome.service import Service
from selenium import webdriver
service = Service(executable_path="/usr/local/bin/chromedriver")
with webdriver.Chrome(service=service) as driver:
driver.get('/')
Screenshot
Summary
In this Python Selenium Tutorial, we learned how to load a specific URL using driver.get() method.