This is my first code in my life.
I try to use a puppeteer.
If I click “test” SUCCESS - code works OK
but if I use trigger SCHEDULE (run code one per day ) - Puppeteer
and RUN NOW option and I will wait until the appropriate designated time to execute the code
I see the error:
TypeError: Cannot read properties of undefined (reading ‘props’)
Error: TypeError: Cannot read properties of undefined (reading 'props') at handleError (/var/task/common.js:38:40) at Runner.runUserCode (file:///var/task/lambda_handler.mjs:901:9) at async Runner.run (file:///var/task/lambda_handler.mjs:732:5) at async Runtime.handler (file:///var/task/lambda_handler.mjs:952:22)
(puppeteer)
code:
import { puppeteer } from ‘@pipedream/browsers’;
//const puppeteer = require(‘puppeteer’);
async function automateTask() {
// Open the browser in headless mode
const browser = await puppeteer.launch({ headless: false });// Go to the website
const page = await browser.newPage();
await page.goto(‘https://www.somepage.com’);/*
const zamknij = await page.waitForSelector(‘#content > section > div.cookies-alert-block > a > p’)
await zamknij.click()
*/
const serwisyinformacyjne = await page.waitForSelector(‘label.select-all-’)
await serwisyinformacyjne.click()const wpisztelefon = await page.waitForSelector(‘input#phone’)
await wpisztelefon.click()await wpisztelefon.type(‘555123123’);
const wymagane = await page.waitForSelector(‘.checkbox > .res’)
await wymagane.click()const wyslij = await page.waitForSelector(‘.form-group > .black.btn’)
await wyslij.click()
await page.waitForTimeout(5000);
await browser.close();
}automateTask();