• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Node.JS Error: Cannot find module 'puppeteer'


New Coder
const automation = require("puppeteer");
const fs = require("fs");
const automationConfiguration = {
    headless: false

    async function runautomation() {

const browser = await automation.launch(automationConfiguration)

const page = await browser.newPage()
const navigationPromise = page.waitForNavigation()

await navigationPromise

await page.goto('https://www.google.com/search?q=perfmatters+vs+wp+rocket&oq=perf&aqs=chrome.0.69i59j69i57j0i67j46i433i512j0i433i512l2j0i131i433i512j69i64.961j0j15&sourceid=chrome&ie=UTF-8')

await page.setViewport({ width: 1366, height: 657 })

await page.waitForSelector('.MjjYud:nth-child(5) > .g > .kvH3mc > .Z26q7c > .yuRUbf > a > .LC20lb')
await page.click('.MjjYud:nth-child(5) > .g > .kvH3mc > .Z26q7c > .yuRUbf > a > .LC20lb')

await navigationPromise

await browser.close() }
Top Bottom