The error the following line:
await page.waitForFunction('document.querySelector(".eo-validation-code").innerText.length == 32');
Here it is in context:
const puppeteer = require('puppeteer');
puppeteer.launch({ignoreHTTPSErrors: true, headless: false}).then(async browser => {
const page = await browser.newPage();
console.log(2);
await page.setViewport({ width: 500, height: 400 });
console.log(3)
const res = await page.goto('.php?UserId=60sEBfXq6wNExN4%2bn9YSBw%3d%3d&ServiceId=f147263e75262ecc82d695e795a32f4d');
console.log(4)
await page.waitForFunction('document.querySelector(".eo-validation-code").innerText.length == 32').catch(err => console.log(err));
It's basically a copy paste of this answer: With the exception that I have changed the querySelector to find an element with the class name "eo-validation-code".
The error the following line:
await page.waitForFunction('document.querySelector(".eo-validation-code").innerText.length == 32');
Here it is in context:
const puppeteer = require('puppeteer');
puppeteer.launch({ignoreHTTPSErrors: true, headless: false}).then(async browser => {
const page = await browser.newPage();
console.log(2);
await page.setViewport({ width: 500, height: 400 });
console.log(3)
const res = await page.goto('https://apps.realmail.dk/scratchcards/eovendo/gui/index.php?UserId=60sEBfXq6wNExN4%2bn9YSBw%3d%3d&ServiceId=f147263e75262ecc82d695e795a32f4d');
console.log(4)
await page.waitForFunction('document.querySelector(".eo-validation-code").innerText.length == 32').catch(err => console.log(err));
It's basically a copy paste of this answer: https://stackoverflow./a/46825433/10238810 With the exception that I have changed the querySelector to find an element with the class name "eo-validation-code".
Share Improve this question asked Aug 20, 2018 at 20:16 Ryan CameronRyan Cameron 3712 gold badges5 silver badges16 bronze badges 1-
By copying paste to Chrome console you will see
.inner..Text
which means there are invisible characters between theinner
and theText
. – Yami Odymel Commented Dec 8, 2020 at 18:34
1 Answer
Reset to default 6Something went wrong with your r
symbol in innerText
(i think it might be BOM)
Try it:
const puppeteer = require('puppeteer');
puppeteer.launch({ignoreHTTPSErrors: true, headless: false}).then(async browser => {
const page = await browser.newPage();
console.log(2);
await page.setViewport({ width: 500, height: 400 });
console.log(3)
const res = await page.goto('https://apps.realmail.dk/scratchcards/eovendo/gui/index.php?UserId=60sEBfXq6wNExN4%2bn9YSBw%3d%3d&ServiceId=f147263e75262ecc82d695e795a32f4d');
console.log(4)
await page.waitForFunction('document.querySelector(".eo-validation-code").innerText.length == 32').catch(err => console.log(err));
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745311585a4622023.html
评论列表(0条)