【发布时间】:2020-08-16 23:49:19
【问题描述】:
我的代码:
const puppeteer = require("puppeteer");
(async () => {
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://www.genglobal.org/member-directory");
await page.type("#edit-field-first-name-value", "Abbas");
await page.type("#edit-field-last-name-value", "AL ASMAR");
await page.click(".agree-button.eu-cookie-compliance-secondary-button");
const [submitSearch] = await Promise.all([
page.waitForNavigation(),
page.click("#edit-submit-member-directory"),
]);
await page.screenshot({ path: "screenshot.png" });
await browser.close();
} catch (error) {
console.log(`this is the ${error}`);
}
})();
错误:
this is the TimeoutError: Navigation timeout of 30000 ms exceeded
我想要达到的目标:
在相应的输入字段中输入名字和姓氏,然后单击过滤器按钮。但是,当我通过单击过滤器按钮提交表单时,它给了我上面提到的错误。我不明白为什么...
【问题讨论】:
标签: javascript node.js web-scraping puppeteer browser-automation