我正试图在一个20年前建立在apache框架上的电子商务网站上实现傀儡操作者的自动化。我不能复制整个struts操作servlet,但是我已经模拟了HTML页面,一旦用户登录并选择Shop,就会在框架中加载14个不同的页面。目标是从加载在第5深度子框架页面中的14页中的一页中单击CreateNewShoping购物篮。该链接调用外部javascript函数,但傀儡师返回此错误:
Error: Evaluation failed: ReferenceError: create_order is not defined
at __puppeteer_evaluation_script__:
我用node和puppeteer结合编写了一个脚本,用于在中遍历多个页面的不同机构的名称。
下面的脚本可以从登陆页面解析机构名称,然后在从其他页面解析名称时启动几次单击,最后在执行过程中的某个点遇到错误。
the error: TypeError: Cannot read property 'click' of undefined
at main (c:\Users\WCS\Desktop\Node vault\comments.js:18:25)
at <anonymous>
at process._tickCallback (inter
我有一个下面的脚本,它隐藏了一个DIV标签(在这个例子中是"foo"),当超链接被点击时。然后显示再次单击该链接的时间。
此脚本非常适合我的使用,但需要稍微修改代码,以移动另一个(在本例中为"bar")。
我想把DIV标签id "bar“移到页面上的另一个位置。再次单击该链接,我希望它再次移回。
<script type="text/javascript">
function toggle_visibility(id) {
var e = document.getElementById(id);
e.style.display
当我尝试通过以下方式逐个单击每个页面时,会出现错误: 我尝试过使用puppeteer的.click函数,但它给出了错误: error:执行上下文被破坏,很可能是因为导航。 const aTags= await page.$$('#someId > a')
for (const aTag of aTags) {
await aTag.click();
//Do stuff
page.goto(url); //this goes back to the initial page with the list of URLs
} 我想逐个单击链接并返回到上一页