A concise demonstration of Python selenium automation

Source: Internet
Author: User

1.selenium Installation:

Pip Install-u Selenium
Reference: Https://pypi.python.org/pypi/selenium#downloads
2. Download the Firefox driver:
Https://github.com/mozilla/geckodriver/releases
3. Configure the directory where the Geckodriver.exe is located to the PATH environment variable
4. A simple example:
1  from Import Webdriver 2 3 driver=webdriver. Firefox ()45 driver.get ("http://www.sogou.com") # The end of the program will automatically open Firefox browser and open Sogou webpage

1  fromSeleniumImportWebdriver2 3Driver=Webdriver. Firefox ()4 5Driver.get ("http://www.sogou.com")6 Print(Driver.title)7 8Driver.get ("http://www.suning.com")#HTTP//Cannot save or will error9 Print(Driver.title)TenDriver.quit ()#The purpose of this statement is to close the black window and the browser

A concise demonstration of Python selenium automation

Related Article

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.