当前位置:网站首页>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()
边栏推荐
- [fluent -- example] case 1: comprehensive example of basic components and layout components
- 【高并发】通过源码深度分析线程池中Worker线程的执行流程
- 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
- Alibaba cloud technology expert Qin long: reliability assurance is a must - how to carry out chaos engineering on the cloud?
- Want to go whoring in vain, right? Enough for you this time!
- If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing
- 什么是CI/CD?
- numpy初识
- 2.1.2 application of machine learning
- 3.2.1 什么是机器学习?
猜你喜欢

Pytorch advanced training skills

Pytorch project practice - fashionmnist fashion classification

The first scratch crawler

Eureka usage record

Azure Devops (XIV) use azure's private nuget warehouse
![SSTI 模板注入漏洞总结之[BJDCTF2020]Cookie is so stable](/img/19/0b943019fe1c959c4b79035a814410.png)
SSTI 模板注入漏洞总结之[BJDCTF2020]Cookie is so stable

Analysis of TCP packet capturing using Wireshark

弹性盒子(Flex Box)详解

【ROS进阶篇】第九讲 URDF的编程优化Xacro使用

什么是CI/CD?
随机推荐
What is ci/cd?
想要做好软件测试,可以先了解AST、SCA和渗透测试
【五】页面和打印设置
推荐系统-协同过滤在Spark中的实现
[fluent -- example] case 1: comprehensive example of basic components and layout components
Feign use
我想问DMS有没有定时备份某一个数据库的功能?
Fiddler packet capturing app
想要白嫖正则大全是吧?这一次给你个够!
1.1.1 欢迎来到机器学习
Numpy first acquaintance
The first scratch crawler
Fiddler抓包APP
【Flutter -- 实例】案例一:基础组件 & 布局组件综合实例
想要做好软件测试,可以先了解AST、SCA和渗透测试
【3】 DEM mountain shadow effect
2022.07.24(LC_6126_设计食物评分系统)
我在源头SQLServer里面登记绝对删除的数据,传到MaxComputer,在数据清洗的时候写绝对
flinkcdc可以一起导mongodb数据库中的多张表吗?
2.1.2 机器学习的应用