from selenium import webdriver

driver = webdriver.Firefox()

first_url = 'https://www.baidu.com'
print("now access %s"%(first_url))
driver.get(first_url)

second_url ='https://news.baidu.com'
print("now access %s" %(second_url))
driver.get(second_url)

print("back to %s"%(first_url))
driver.back()

print("foeward to %s"%(second_url))
driver.forward()
