python - How to click a span text using selenium Python
问题描述
I have been trying to use selenium python to click the continue button in Login Page from the below link.
I have tried several selectors, xpath..nothing seems working for me.
This is the element I am trying to click on:
driver.find_element_by_xpath("//span[text()='Continue']").click()
Tried with Div class too:
driver.find_element_by_xpath("//div[contains(@class, 'appendBottom25 ')]")
I expect the selenium to click the continue button and to load to the password page
解决方案
You are using right xpath
Solution :
perform the click operation twice :
element =driver.find_element_by_xpath("//span[text()='Continue']")
element.click()
element.click()
It is a strange solution but .. I got solved this problem same way only.
推荐阅读
- node.js - 如何发出获取请求
快递中的头部请求? - tensorflow - 如何在 Vespa 中保护 Tensorflow?
- c# - C# WinForms 线程管理器
- java - 错误:在项目“应用程序”中,已解决的 Google Play 服务库依赖项依赖于另一个具有确切版本的依赖项
- swift - 在 super 中定义的常量不能在子类的 super.init 中使用?
- javascript - 在 PHP 中创建 onchange/oninput 监听器
- php - 如何使用内部连接通过 URL 解析 ID
- java - 无法将字符串接收到 Spring 端点
- python - 我定义了一个具有两个输出的函数并返回一个列表。如何调用最小化函数中的输出之一?
- javascript - 如何使用 javascript 检测错误标记的 WebP 文件?