Select checkbox using Selenium with Python

后端 未结 6 1884
鱼传尺愫
鱼传尺愫 2020-12-25 10:45

How can I select the checkbox using Selenium with Python?

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

browser = webdriver.         


        
6条回答
  •  情书的邮戳
    2020-12-25 11:17

    The checkbox HTML is:

    
    

    so you can use

    browser.find_element_by_id("C179003030-ORNL_DAAC-box").click()
    

    One way you can find elements' attributes is using the Google Chrome Developer Tools:

    Inspect element

提交回复
热议问题