【发布时间】:2020-08-20 17:35:04
【问题描述】:
我正在使用 python selenium 自动下载财务报告。为此,我必须使用这个虚拟键盘输入我的密码:
我正在尝试通过 xpath 点击我密码的每个字母:
object = driver.find_element_by_xpath('//*[@id="alphaKeyboard"]/area[13]')
object.click()
每个字母的XPath非常相似,只是改变了*area[]*里面的数字
但我收到以下错误:
selenium.common.exceptions.JavascriptException: Message: javascript error: shape=rectangle is not supported
我想这个问题与包含虚拟键盘的 shape='rectangle' 元素有关,每个字母的完整 html 元素看起来像这样,例如 letther 'F':
<area shape="rectangle" coords=" 72, 22, 93, 44" onclick="writeAlpha('F')" onmouseover="setHandCursor(document.alphaKeyboard)" onmouseout="setDefaultCursor(document.alphaKeyboard)">
对此有什么建议吗?
如果你想试试,我给你网址:
https://sucursalempresas.transaccionesbancolombia.com/SVE/control/BoleTransactional.bancolombia
【问题讨论】:
-
只是仔细检查,是
object.click()行抛出的错误吗? -
嗨,@M Z,是的,错误在 object.click() 行中。如果你想试试这个是网址:sucursalempresas.transaccionesbancolombia.com/SVE/control/…
标签: javascript python selenium selenium-webdriver