(a) using the selenium automatically 12306 website ticket query
1, what is the selenium??
Selenium: support various browser driver can drive real browser to complete our test
2, the Selenium works
3, selenium install
Pip install selenium
4, how to use the selenium
(1) introduction: from the selenium import webdriver (from the selenium import webdriver)
(2) how to make the webdriver real open a browser? To install the browser driver and into the python installation folder
(3) from the selenium import webdriver
(4) in python code is as follows, can open the baidu:
The import time
The from the selenium import webdriver
Driver=webdriver. Chrome ()
Driver. The get (' http://www.baidu.com ')
Time. Sleep (10)
Driver. Find_element_by_id (' kw). Send_keys (' selenium)
CodePudding user response:
Should first clear input boxCodePudding user response: