当前位置:网站首页>Selenium use -- installation and testing
Selenium use -- installation and testing
2022-07-25 12:39:00 【Smell and break bamboo】
List of articles
install selenium
In general , Use it directly pip Can be installed
pip install selenium
But if you meet urllib3 Version conflict of , It needs to be solved like this
First uninstall the original selenium and urllib3
pip uninstall selenium
pip uninstall urllib3
Install a specific version of urlib3
pip install urllib3==1.25.11
Install a specific version of selenium
pip install selenium==4.0.0.a1
Configure browser driver
If you want to selenium It can drive the browser into automatic test mode , You need to install the driver of a specific browser
Determine the browser version
Enter in the address field
chrome://version

Get into Taobao mirror Download to drive



Configure boot environment
Decompress the downloaded compressed package , Get one chromedriver.exe Program ( Suppose the file path of the program is :D:\Code\Selenium_Test), You need to configure this path into the environment variable .
test
After configuring the appeal process , You can use the following code to test
from selenium import webdriver
driver = webdriver.Chrome() # Create a Chrome Of driver Instance object
# Access page
driver.get(url="https://www.baidu.com/")
# Search the page id by kw Box of , Input xxx
driver.find_element_by_id("kw").send_keys("xxx")
# Search the page id by su The button , Click
driver.find_element_by_id("su").click()
# sign out
# driver.quit()
边栏推荐
- Fault tolerant mechanism record
- R language ggpubr package ggarrange function combines multiple images and annotates_ Figure function adds annotation, annotation and annotation information for the combined image, adds image labels fo
- 第一个scrapy爬虫
- WPF project introduction 1 - Design and development of simple login page
- How to access DMS database remotely? What is the IP address? What is the user name?
- Perf performance debugging
- Monit installation and use
- Is the securities account opened by qiniu safe? How to open an account
- Implementation of recommendation system collaborative filtering in spark
- 【二】栅格数据显示拉伸色带(以DEM数据为例)
猜你喜欢

2022.07.24(LC_6126_设计食物评分系统)

2.1.2 application of machine learning

LeetCode 1184. 公交站间的距离

Detailed explanation of flex box

基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现

想要白嫖正则大全是吧?这一次给你个够!

PyTorch项目实战—FashionMNIST时装分类

If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing

More accurate and efficient segmentation of organs-at-risk in radiotherapy with Convolutional Neural

Feign use
随机推荐
WPF project introduction 1 - Design and development of simple login page
Plus SBOM: assembly line BOM pbom
Is the securities account opened by qiniu safe? How to open an account
Communication bus protocol I: UART
Pytorch project practice - fashionmnist fashion classification
想要白嫖正则大全是吧?这一次给你个够!
2022.07.24(LC_6126_设计食物评分系统)
Jenkins configuration pipeline
R language uses LM function to build multiple linear regression model, step function to build forward stepwise regression model to screen the best subset of prediction variables, and scope parameter t
【五】页面和打印设置
Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
2022 Henan Mengxin League game (3): Henan University I - Travel
[high concurrency] deeply analyze the execution process of worker threads in the thread pool through the source code
【二】栅格数据显示拉伸色带(以DEM数据为例)
[micro service ~sentinel] sentinel degradation, current limiting, fusing
Want to go whoring in vain, right? Enough for you this time!
Build a series of vision transformer practices, and finally meet, Timm library!
【ROS进阶篇】第九讲 URDF的编程优化Xacro使用
A method to prevent SYN flooding attacks -- syn cookies
力扣 83双周赛T4 6131.不可能得到的最短骰子序列、303 周赛T4 6127.优质数对的数目