Python+selenium2 (b)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.