我试图通过Puppeteer点击输入元素后去我请求的URL我使用
输入一个数量await page.type('#bidamount_temp', bidAmount);
Puppeteer没有抱怨这个错误:然而,在向字段中输入值之后;我想让木偶师点击这个按钮:
<input type="submit" value="Place Bid " class="buttonspb" style="font-size:15px; margin-top:-2px;" onclick="return url_check();">
我在node。js代码中使用了这个
await Promise.all([
page.click('input[value="Place Bid "]'),
page.waitForNavigation({ waitUntil: 'networkidle0' }),
]);
然而,它给了我一个错误:
错误:Error: No node found for selector: input[value="Place Bid"]
您可以在错误消息中看到它从按钮值中剥离空间:您有"Place Bid "
, puppeteer将其转换为"Place Bid"
。您应该使用另一个选择器来访问按钮,例如input[type="submit"].buttonspb