当前位置:网站首页>Selenium check box
Selenium check box
2022-07-03 23:10:00 【thorne_】
Take Sina Weibo registration page as an example , Check the individual check boxes : Check here ‘ Journalism ’ Check box as an example

Code ideas : By positioning the check box xpth, And then click .
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://login.sina.com.cn/signup/signup?entry=homepage") # Sina registration page
element = driver.find_element(By.XPATH,'//*[@id="phone-form"]/div[4]/div[2]/label[1]/input').click()Check all check boxes : Locate through the same attribute of each check box , And then click
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://login.sina.com.cn/signup/signup?entry=homepage")
# Find the same attribute for each check box element
elements = driver.find_elements(By.NAME,'hobbies[]')
for element in elements:
element.click()边栏推荐
- AST (Abstract Syntax Tree)
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- How to switch between dual graphics cards of notebook computer
- How to quickly build high availability of service discovery
- Shell script three swordsman awk
- How to restore the factory settings of HP computer
- Shiftvit uses the precision of swing transformer to outperform the speed of RESNET, and discusses that the success of Vit does not lie in attention!
- Classification and extension of OC
- Runtime. getRuntime(). totalMemory/maxMemory()
- Get current JVM data
猜你喜欢

Es6~es12 knowledge sorting and summary
![Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~](/img/af/1975b37d81bbdb9709ff181b9a72f9.jpg)
Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~

Recursive least square adjustment

Fluent learning (4) listview

The difference between single power amplifier and dual power amplifier

How the computer flushes the local DNS cache

MLX90614 driver, function introduction and PEC verification

The difference between SRAM and DRAM

Esp-idf turns off serial port log output.

Blue Bridge Cup -- guess age
随机推荐
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Flutter internationalized Intl
Take you to master the formatter of visual studio code
Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet
Simple solution of m3u8 file format
How about opening an account at Hengtai securities? Is it safe?
6.2 normalization 6.2.5 third normal form (3NF)
Op amp related - link
Learning notes of raspberry pie 4B - IO communication (SPI)
Runtime. getRuntime(). totalMemory/maxMemory()
[note] IPC traditional interprocess communication and binder interprocess communication principle
[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list
炒股开户佣金优惠怎么才能获得,网上开户安全吗
finalize finalization finally final
Format cluster and start cluster
Sort merge sort
ADB related commands
540. Single element in ordered array
Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
Ansible common usage scenarios