Selenium + Python · Lesson 15 of 43
Module 15: WebDriver
Your task
Implement navigate_and_maximize(driver, target_url):
Write it in the editor, then press Check answer (Ctrl + Enter).
from selenium import webdriver
driver = webdriver.Chrome()
driver.maximize_window()
# Navigation:
driver.get("https://targetqa.com")
driver.get("https://targetqa.com/courses")
driver.back()
driver.forward()
driver.refresh()
# Page Properties:
print("Current URL:", driver.current_url)
print("Title:", driver.title)WebDriver in Python offers an intuitive API for navigating URLs, manipulating browser windows, and inspecting page properties. In this lesson, you will master get(), title, current_url, back(), forward(), and window maximizing. Let's master WebDriver methods!
Part of the Selenium + Python course (Selenium with Python). Practice this concept live in the Selenium Online Compiler or explore our free automation practice form.
In Python, driver.title and driver.current_url are properties (no parentheses needed), unlike driver.getTitle() in Java.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___