Python中文
首页
教程
问答
标签
搜索
登录
注册
如果在使用.clear()或.send_keys()后按钮被禁用,如何使用Python Selenium单击(绕过)提交按钮?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>正如标题所说,当使用方法<code>clear</code>或<code>send_keys</code>后,按钮得到“<code>disabled</code>”,我如何使用<code>.click()</code>a<code>button</code>?在</p> <hr/> <p><strong>之前:</strong></p> <p><a href="https://i.stack.imgur.com/NGriJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NGriJ.png" alt="enter image description here"/></a></p> <hr/> <p>这是我打开页面时的状态<code>url</code>。。。但是在我运行代码找到<code>textbox</code>和<code>replace</code>的值之后,元素就在我<code>clear</code>它的内容之后得到{<cd4>}(可能是某种形式的{<cd11>}),或者使用<code>send_keys</code>向其写入内容。在</p> <hr/> <p><strong>之后:</strong></p> <p><a href="https://i.stack.imgur.com/m3E3w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m3E3w.png" alt="enter image description here"/></a></p> <hr/> <p><strong>代码:</strong></p> <pre><code>txt_value = driver.find_element_by_xpath('//input[@id="txtValor4"]') txt_value.clear() #this disables the button txt_value.send_keys(str(123,45)) #this also disables the button </code></pre> <p><strong>我的问题是:</strong></p> <blockquote> <p>How can I bypass this website protection and press the <code>Continuar</code> button?</p> </blockquote> <p>我考虑过禁用<code>JS</code>,但是整个网站都依赖它来生成所需的文档。。错误的选择。在</p> <p>所以我考虑使用按钮属性来模拟按钮的按下。。。只是不知道有没有可能,或者我怎么能做到。在</p> <p>另一个选项是只阻止<code>JS</code>,它使用<code>inspect element</code>和<code>network tools</code>禁用命令的按钮映射。。。在</p> <p>那么有什么方法可以达到这个目的吗?在</p> <p><em>ps:我不能给出URL,因为它需要我的登录数据。</em></p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>如果您没有使用selenium和javascript的任何解决方案,那么可以使用Sikuli概念。要单击该元素,请获取“Continuar”按钮的图像并将其保存在resources文件夹中。在</p> <pre><code>String elementImg=Path of the Image; screen.click(elementImg); </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
pyVISA GPIB GET(组执行触发器)
5 回答
Pyvisa IOerror设备:Korad K3005d电源
9 回答
PyVISA mac OS X(山狮)安捷伦33250
5 回答
Pyvisa Pyusb无法加载大于1 MB的序列
1 回答
pyVisa RS232太慢
9 回答
PyVISA RS232超时错误(安捷伦电源)
1 回答
PyVISA SCPI命令和查询(值更新问题)
2 回答
PyVISA SerialInstrument需要硬重置才能在故障后连接
10 回答
pyvisa,未找到函数viOpen
9 回答
pyVISA:以编程方式将仪器返回到本地模式
8 回答
pyvisa:接口类型是什么意思?
9 回答
pyvisa.errors.VisaIOError:VI_ERROR_TMO(1073807339):操作完成前超时
6 回答
PyVisa“更复杂的示例”根本不运行Keithley 2400不理解的命令
8 回答
PyVisapy后端
9 回答
PyVISA不能写入超过7F的十六进制字符
9 回答
PYVISA中的ENUM模块和cStringIO模块
6 回答
PyVisa代码的图形用户界面
3 回答
Pyvisa使用按键电源超时
4 回答
PyVISA和Kethley 2701只能从一个通道获取结果
1 回答
PyVisa和Printing New D
10 回答