gpt4 book ai didi

javascript - 机器人框架>>jquery>>执行Javascript命令

转载 作者:行者123 更新时间:2023-11-28 10:56:21 25 4
gpt4 key购买 nike

我正在使用机器人框架,我必须使用 jquery 获取一些网格内容。我使用了“执行Javascript”命令。但它无法识别任何 jquery 命令,例如 document.或窗口。我正在使用 selenium 2。过去两天我用谷歌搜索没有找到相关答案。请告诉我我们是否需要提供任何新的库或下载 selenium1 库而不是 selenium2。

ERROR: javascript | FAIL | WebDriverException: Message: u"unknown error: Object [object global] has no method 'getElementById'\n (Session info: chrome=32.0.1700.107)\n (Driver info: chromedriver=2.8.241075,platform=Windows NT 6.1 SP1 x86_64)"

最佳答案

http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Execute%20Javascript

Note that, by default, the code will be executed in the context of the Selenium object itself, so this will refer to the Selenium object. Use window to refer to the window of your application, e.g. window.document.getElementById('foo').

关于javascript - 机器人框架>>jquery>>执行Javascript命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21595807/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com