Open FloRinke opened 3 years ago
I have a feeling this issue masks available appointments.... Just noticed that often after seeing this issue, in the next successful run the hash has changed.
Thank you! Unfortunately, I won't have time to look into it over the next few days – please feel free to continue posting if you make any new discoveries. Otherwise, I can always recommend running the bot in non-headless mode and observing what happens, ideally with some console.log("Hello world.")
statements in the flow.
I seams that by increasing this timeout value to 30 * 1000
instead of 10 * 1000
solves the problem:
await page.waitForResponse(
(res) => res.url().indexOf("terminpaare") !== -1,
{ timeout: 10 * 1000 }
);
I am attaching code snippet. You can use that and modify according to your scenario. It helps in dealing with timeout error related issues.
const puppeteer = require("puppeteer"); const { scrollPageToBottom } = require('puppeteer-autoscroll-down')
async function scrape () {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto("https://twitter.com/elonmusk", {waitUntil: "networkidle2"});
let isLoadingAvailable = true // Your condition-to-stop
while (isLoadingAvailable) {
try{
await scrollPageToBottom(page, { size: 250 , delay: 500})
await page.waitForResponse(
response => response.url() === 'https://twitter.com/elonmusk' && response.status() === 200
)
} catch (ex) {
continue;
}
isLoadingAvailable = false // Update your condition-to-stop value
}
console.log("Loading done")
await browser.close();
}; scrape();
This work in 100% of the cases for me. You can check it out.
await page.waitForSelector( "", { visible: true, waitUntil: "load", waitUntil: "networkidle0", waitUntil: "domcontentloaded", waitUntil: "networkidle2", timeout: 10 * 1000, } );
I have exactly the same error with the latest version of puppeteer (21.5.0). Approximately one time out of 2, the error is impossible to catch with the try catch block, and the script ends by crashing.
/home/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:59 void this.terminate(new Errors_js_1.TimeoutError(
Waiting failed: ${options.timeout}ms exceeded
)); ^TimeoutError: Waiting failed: 15000ms exceeded at Timeout.
(/home/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:59:37) at listOnTimeout (node:internal/timers:564:17) at process.processTimers (node:internal/timers:507:7)
try {
const pages = await currentBrowserInstance.browser.pages();
const page = pages[0];
await page.setViewport({ width: 100, height: 100 });
const watchDog = page.waitForFunction('!!window.DRAW_FINISH', {timeout: timeout});
await page.goto(backendURL, {timeout: timeout});
await watchDog;
}
catch(e) {
console.error(e);
}
Hi, I am facing a similar issue:
https://github.com/oppia/oppia/actions/runs/9994971012/job/27627319315
When querying the URL with Vermittlungscode, every second to third time this fails with a TimeoutError:
Im running current master with this call (redacted for privacy):
Please tell if I can assisst in debugging, unfortunately JavaScript is not my strong suit (else I'd prefer sending PRs over Issues).