对于pincode,我试过这个:
checkbox = webdriver.find_elements_by_xpath('//*[@name="add_in_fld"].onclick()')
if checkbox.isSelected():
checkbox.click()
答案 0 :(得分:0)
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.findlatitudeandlongitude.com/batch-geocode/#.VbsHL7OqpHz")
cb = driver.find_element_by_css_selector(".cb_short input")
assert cb.is_selected()
cb.click()
assert not cb.is_selected()