After reading the first program, there may be no understanding of the place, there is a way to locate elements, then the specific way to describe the positioning. This article describes the operation of the browser.
(1) browser maximization is a bit of a problem,
Message:unknown error:cannot Get Automation extension
From unknown error:page could not be found:chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background _page.html waiting to be solved
1 from Import Webdriver 2 driver=webdriver. Chrome ()34 driver.get ('http://www.baidu.com') 5 Driver.maximize_window () # Browser maximization
(2) Set browser width, height
1 from Import webdriver23 driver=webdriver. Chrome ()45 driver.set_window_size (500,500) # Set browser width 500 high
(3) browser forward, back
1 fromSeleniumImportWebdriver2 3 4Driver=Webdriver. Chrome ()5 6First_url='http://www.baidu.com'7 driver.get (First_url)8 9Second_url='https://github.com'Ten driver.get (Second_url) One A Driver.back () - -Driver.forward ()
Python+selenium2 (b)