Write First Program in Selenium Python

Profile picture for user arilio666

In this article, we will write our first Python selenium program.

  • We will navigate to the page.
  • Print the current URL name and title of the page.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.maximize_window()
driver.get('https://www.programsbuzz.com')
print('Title: ' ,driver.title)
print('Url:', driver.current_url)
  • Using the web driver manager, we initialized the Chrome browser, and then, using the get method, we navigated to the program's buzz site.
  • Using title and current_url, we got those infos as well.
Write First Program in Selenium Python
  • We are using VsCode as an ide interpreter in this example.