Я пытаюсь построить веб-скребок, используя кукловода, который просматривает мою страницу Venmo для поиска платежей. Когда я пытаюсь запустить свой скрипт, я получаю сообщение об ошибке: «page.goto - это не функция»
Честно говоря, я не совсем уверен, с чего начать
const puppeteer = require('puppeteer');
const url = 'generic.com';
(async () => {
//running in headless to observe what happens for now
const browser = await puppeteer.launch({headless: false});
const page = browser.newPage();
await page.goto(url);
let data = await page.evaluate(() => {
let amount = document.querySelector('span.bold.medium.green').innerText;
let timePayed = document.querySelector('a.grey_link').innerText;
return {
amount,
timePayed
}
});
console.log(data);
debugger;
await browser.close();
})();
Это мое сообщение об ошибке
UnhandledPromiseRejectionWarning: TypeError: page.goto is not a function
at D:\venmoScraper\scraper.js:12:12
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:13212) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was not
handled with .catch(). (rejection id: 1)
(node:13212) [DEP0018] DeprecationWarning: Unhandled promise rejections
are deprecated. In the future, promise rejections that are not handled
will terminate the Node.js process with a non-zero exit code.