python + selenium + chrome web automation

python + selenium + chrome web automated testing:

1, mounted in selenium in pycharm: file-setting-project interpreter searches selenium and install;

2, download and install the Google browser driver;
  reference installation path by students: https: //www.cnblogs.com/qiezizi/p/8632058.html is very simple;
After downloading, we'll download the file in the Python the root of it.

3, and the new project file .Py:
Example:
from the webdriver # Import Selenium introduced driver
WD = webdriver.Chrome ()                                              
wd.get ( 'https://www.baidu.com/')                               
wd.find_element_by_xpath ( '// * [@ id = "kw"] '). send_keys ( " blog Park")    
wd.find_element_by_xpath (' // * [@ the above mentioned id = "su"] '). the Click ()                 

Guess you like

Origin www.cnblogs.com/jeanny2019/p/12106488.html