当前位置:网站首页>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()边栏推荐
- Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)
- Subset enumeration method
- Quick one click batch adding video text watermark and modifying video size simple tutorial
- How can enterprises and developers take advantage of the explosion of cloud native landing?
- The difference between SRAM and DRAM
- 2022.02.13
- Design of logic level conversion in high speed circuit
- Ppt image processing
- The difference between single power amplifier and dual power amplifier
- Es6~es12 knowledge sorting and summary
猜你喜欢

Hcip day 12 notes

How to quickly build high availability of service discovery

The 2022 global software R & D technology conference was released, and world-class masters such as Turing prize winners attended
![[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list](/img/db/b992d2b461ca17652518a1511b4947.gif)
[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list

The difference between single power amplifier and dual power amplifier
![[network security] what is emergency response? What indicators should you pay attention to in emergency response?](/img/ff/c733ffbb922760910ab09af3ae2886.jpg)
[network security] what is emergency response? What indicators should you pay attention to in emergency response?

A preliminary study on the middleware of script Downloader

The reason why the computer runs slowly and how to solve it

Runtime. getRuntime(). totalMemory/maxMemory()

Can you draw with turtle?
随机推荐
[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list
C deep anatomy - the concept of keywords and variables # dry inventory #
Classification and extension of OC
Creation of the template of the password management software keepassdx
C summary of knowledge point definitions, summary notes
Qtoolbutton available signal
320. Energy Necklace (ring, interval DP)
To rotate 90 degrees clockwise and modify the video format
Day30-t540-2022-02-14-don't answer by yourself
Fluent learning (4) listview
Label coco format data and format data in the upper left corner and lower right corner are mutually converted
LeetCode 1646. Get the maximum value in the generated array
Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
Summary of fluent systemchrome
Apple released a supplementary update to MacOS Catalina 10.15.5, which mainly fixes security vulnerabilities
Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)
2022.02.13
6.2 normalization 6.2.5 third normal form (3NF)
FPGA tutorial and Allegro tutorial - link
Pyqt5 sensitive word detection tool production, operator's Gospel