【发布时间】:2019-10-13 01:58:49
【问题描述】:
https://agent.loadbook.in/#/login 当我进入注册表单时,表单有一个复选框,因为我同意该条件。这是一个输入标签复选框。当我按 id 选择标签时,当我执行 click 或 send_key 提交其显示复选框不可点击时。
以下所有方法都不起作用
driver.find_element_by_xpath('//div[@class="switch__container"]//input').click()
driver.find_element_by_xpath('//div[@class="switch__container"]//input').send_keys(Keys.ENTER)
driver.find_element_by_xpath('//div[@class="switch__container"]//input').submit()
driver.find_element_by_xpath('//div[@class="switch__container"]//input').send_keys("after")
driver.find_element_by_xpath('//div[@class="switch__container"]//label').click()
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://agent.loadbook.in/#/login")
driver.find_element_by_partial_link_text("Create an account").click()
尝试:
driver.find_element_by_xpath('//div[@class="switch__container"]//input').click()
# driver.find_element("name","username").send_keys("test")
# driver.find_element("name","email").send_keys("test@test.com")
# driver.find_element("name","phone").send_keys("99999999")
# driver.find_element("name","password").send_keys("12345")
除了 NoSuchElementException 作为异常: print("未找到")
selenium.common.exceptions.ElementNotVisibleException:消息: 元素不可交互
【问题讨论】:
-
在注册页面上它不是复选框实际上是它的切换
标签: python selenium checkbox css-selectors webdriverwait