I want to extract the text result with the "input#Readonly1"
selector. But unfortunately I get an empty text. (value contain an empty text)
const puppeteer = require('puppeteer');
var sleep = require('system-sleep');
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://www.mobilit.fgov.be/WebdivPub_FR/wmvpstv1_fr?SUBSESSIONID=16382865', { timeout: 8000 });
const elementHandle = await page.$(
'frame[name="AppWindow"]',);
const frame = await elementHandle.contentFrame();
await frame.type("input[name='Writable3']", 'VF33C9HYB84113557', { delay: 5 });
await frame.$eval("button[name='btnOphalen']", el => el.click());
const element = await frame.waitForSelector("input#Readonly1", {visible: true}); // select the element
const value = await element.evaluate(el => el.textContent);
console.log(value);
await browser.close();
})();
I think this line of code is incorrect:
const element = await frame.waitForSelector("input#Readonly1", {visible: true});