A Selenium request library
1 What is selenium
Selenium is an automated testing tool that can help me to realize drive through the code browser automatically perform the appropriate actions, so we can use it for reptiles
2 Why use the Selenium ?
The main use Selenium purpose is to skip the login authentication
3 Installation and use
- Download Drive
http://npm. taobao. org/mirrors/ chromedriver/2.38/
Download a selenium request library
Download a modified source Tsinghua source
一D: \python36\Lib\site-packages \pip models\index. py
一PyPI = Index(' https://pypi. tuna. tsinghua. edu. cn/simple' )
A pip3 install sel enium or settings installed
Two ways to drive a browser
# 1 The first directly to the Script find the driver in the folder
from the Selenium Import webdriver Import Time # go directly to the Script folder for the driver Driver = webdriver.Chrome () time.sleep(5) driver.close()
# A second driver to fill in the path
#webdriver.()
#webdriver.Chrome(r’F:\python36\Scripts\chromedriver.exe’)