-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathos.py
More file actions
21 lines (14 loc) · 461 Bytes
/
os.py
File metadata and controls
21 lines (14 loc) · 461 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#coding=utf-8
from selenium import webdriver
import os
driver=webdriver.Firefox()
file_path="file:///"+os.path.abspath("checkbox.html")
file_path="file:///"+os.path.abspath("checkbox.html")
driver.get(file_path)
#找出tag为input的元素
inputs=driver.find_elements_by_tag_name("input")
#找出type为checkbox的元素 单击
for input in inputs:
if input.get_attribute("type")=="checkbox":
input.click()
driver.quit()