background : Arrears before reissue ,17 It was written locally in , Never uploaded
This is python+selenium Browser control of , Forward , back off , size , Refresh etc
#coding=utf-8
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get('http://www.baidu.com')
driver.set_window_size(480,800)
# Set browser size
time.sleep(2)
driver.maximize_window()
# Browser full screen
time.sleep(2)
#driver.find_element_by_id("kw").send_keys("selenium")
# adopt id Locate the input box , The back can speak
#driver.find_element_by_id("su").click()
# adopt id location “ use Baidu Search ”, The back can speak
#time.sleep(4)
# wait 4 second
driver.quit()
# Close the browser
#coding=utf-8
# Forward and backward
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get('http://www.baidu.com')
driver.find_element_by_link_text(u' Journalism ').click()
time.sleep(2)
driver.back()
time.sleep(2)
driver.forward()
time.sleep(2)
driver.quit()
#coding=utf-8
# Refresh
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get('http://www.baidu.com')
driver.find_element_by_link_text(u' Journalism ').click()
time.sleep(2)
driver.refresh()
time.sleep(2)
driver.quit()