WebDriver Navigational Commands - - Selenium Automation with Python, Pycharm IDE
Click See More for the code:
Code Starts Here - - - - - - - - - - - - - - - - - - - - *- - - - - - - - - - - - - - - -
from selenium import webdriver
import time
#options = webdriver.ChromeOptions() options.add_argument("user-data-dir=C:\\Users\\RvBVakama\\AppData\\Local\\Google\\Chrome\\User Data AUTO") options.add_argument('--profile-directory=Profile 1') w = webdriver.Chrome('C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe', options=options)
driver = webdriver.Chrome(executable_path="C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe")
driver.get("http://Linkedin.com/")
print(driver.title) # Page 1
driver.get("https://www.linkedin.com/content-hub/...")
print(driver.title) # Page Discover
time.sleep(5)
driver.back()
print(driver.title)
time.sleep(5)
driver.forward()
print(driver.title)
time.sleep(5)
driver.quit()