I am currently working on extracting the innerHTML value of a button from a webpage using puppeteer. My current approach involves awaiting the appearance of the selector before proceeding with the operation.
However, upon executing the code below, the program times out during the wait process.
const puppeteer = require("puppeteer");
const link =
"https://etherscan.io/tx/0xb06c7d09611cb234bfcd8ccf5bcd7f54c062bee9ca5d262cc5d8f3c4c923bd32";
async function configureBrowser() {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(link);
return page;
}
async function findFee(page) {
await page.reload({ waitUntil: ["networkidle0", "domcontentloaded"] });
await page.waitForSelector("#txfeebutton");
console.log("boom");
}
const setup = async () => {
const page = await configureBrowser();
await findFee(page);
await browser.close();
};
setup();
Despite confirming the existence of the element within the HTML:
https://i.sstatic.net/98ifd.png
The console output indicates a timeout issue: