puppeteer | Node.js API for Chrome | Automation library

 by   puppeteer TypeScript Version: 22.8.0 License: Apache-2.0

kandi X-RAY | puppeteer Summary

kandi X-RAY | puppeteer Summary

puppeteer is a TypeScript library typically used in Automation, Nodejs applications. puppeteer has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.

            kandi-support Support

              puppeteer has a medium active ecosystem.
              It has 83627 star(s) with 8996 fork(s). There are 1197 watchers for this library.
              There were 10 major release(s) in the last 6 months.
              There are 274 open issues and 5786 have been closed. On average issues are closed in 159 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of puppeteer is 22.8.0

            kandi-Quality Quality

              puppeteer has 0 bugs and 0 code smells.

            kandi-Security Security

              puppeteer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              puppeteer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              puppeteer is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              puppeteer releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 911 lines of code, 0 functions and 292 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of puppeteer
            Get all kandi verified functions for this library.

            puppeteer Key Features

            No Key Features are available at this moment for puppeteer.

            puppeteer Examples and Code Snippets

            puppeteer - detect sniff
            JavaScriptdot img1Lines of Code : 27dot img1License : Non-SPDX (Apache License 2.0)
            copy iconCopy
             * Copyright 2017 Google Inc., PhantomJS Authors All rights reserved.
             * Licensed under the Apache License, Version 2.0 (the "License");
             * you may not use this file except in compliance with the License.
             * You may obtain a copy of the Licens  
            puppeteer - cross browser
            JavaScriptdot img2Lines of Code : 23dot img2License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            const puppeteer = require('puppeteer');
             * To have Puppeteer fetch a Firefox binary for you, first run:
             *  PUPPETEER_PRODUCT=firefox npm install
             * To get additional logging about which browser binary is executed,
             * run this example as:
            puppeteer - search
            JavaScriptdot img3Lines of Code : 22dot img3License : Non-SPDX (Apache License 2.0)
            copy iconCopy
             * Copyright 2017 Google Inc. All rights reserved.
             * Licensed under the Apache License, Version 2.0 (the "License");
             * you may not use this file except in compliance with the License.
             * You may obtain a copy of the License at
             *     http  
            Puppeteer | Launching and running Chrome (not Chromium) on Visual Studio Code
            JavaScriptdot img4Lines of Code : 14dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const puppeteer = require('puppeteer')
            const fs = require('fs/promises')
            async function start() {
               const browser = await puppeteer.launch( { headless: false,
                   executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome
            Node JS Puppeteer click on a li element without name or id
            JavaScriptdot img5Lines of Code : 25dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const puppeteer = require("puppeteer"); // ^13.5.1
            let browser;
            (async () => {
              browser = await puppeteer.launch({headless: false});
              const [page] = await browser.pages();
              await page.setRequestInterception(true);
            Puppeteer , bringing back blank array
            JavaScriptdot img6Lines of Code : 48dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const puppeteer = require("puppeteer"); // ^13.5.1
            let browser;
            (async () => {
              browser = await puppeteer.launch({headless: true});
              const [page] = await browser.pages();
              const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW
            TypeError: response.postData is not a function
            JavaScriptdot img7Lines of Code : 51dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const puppeteer = require("puppeteer"); // ^13.5.1
            const html = `
            let browser;
            (async () => {
              browser = await puppeteer.launch({headless: true});
              const [page] = await browser.pages();
              const responsePromise = new Promise(re
            Puppeteer page.mouse.down() / up() not the same as clicking physical mouse?
            JavaScriptdot img8Lines of Code : 16dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import puppeteer from 'puppeteer';
            const browser = await puppeteer.launch({ headless: false, defaultViewport: null });
            try {
              const [page] = await browser.pages();
              await page.goto('https://www.dextools.io/app/bsc', { timeout: 0 });
            Dynamic API is not calling on a scroll in puppeteer
            JavaScriptdot img9Lines of Code : 94dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const url = 'https://www.chapters.indigo.ca/en-ca/new-arrivals/?link-usage=Header%3A%20New&mc=NewArrivals&lu=Main/'
            await page.goto(url, { waitUntil: 'networkidle0' })
            try {
                await page.click('section#br
            Not valid Selector/Error: No node found for selector
            JavaScriptdot img10Lines of Code : 63dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const product_url = "https://www.amazon.co.uk/Usoun-Multi-Angle-Heat-Vent-Adjustable-Compatible/dp/B086HNM8F7/ref=sr_1_7?crid=16VVWBHJOOAYE&keywords=laptop+stand+adjustable&qid=1645642193&sprefix=laptop+stand+adjustable%2Caps%2

            Community Discussions


            Node JS Puppeteer click on a li element without name or id
            Asked 2022-Apr-04 at 14:51

            I'm trying to click on a li element which for some reason works as a size selector on a certain website. It looks like this

            And its html looks like this


          • represents one size option, I've tried some stuff but none of it works.

            my first attempt was using xpath:

          • ANSWER

            Answered 2021-Aug-24 at 19:03


            Puppeteer , bringing back blank array
            Asked 2022-Apr-02 at 00:08

            I'm trying to grab products from ebay and open them on amazon.

            So far, I have them being searched on amazon but I'm struggling with getting the products selected from the search results.

            Currently its outputting a blank array and im not sure why. Have tested in a separate script without the grabTitles and the for loop. So im guessing there is something in that causing an issue.

            Is there something i am missing here thats preventing the data coming back for prodResults?



            Answered 2022-Apr-01 at 21:18

            You've hit on an age old problem with Puppeteer and knowing when a page has fully completed rendering or loading.

            You could try adding the following:

            Source https://stackoverflow.com/questions/71711794


            Puppeteer page.mouse.down() / up() not the same as clicking physical mouse?
            Asked 2022-Mar-02 at 21:17

            At the following site, after entering a search phrase such as "baby" (try it!), the Puppeteer call page.mouse.down() doesn't have the same effect as clicking and holding the physical mouse: https://www.dextools.io/app/bsc

            After entering a search phrase, a fake dropdown select menu appears, which is really an UL, and I am trying to click the first search result. So I use code like this



            Answered 2021-Aug-19 at 04:26

            Instead of two separate mouse-down and up operations, you could try this according to puppeteer docs:

            Source https://stackoverflow.com/questions/68702281


            How Can I Tell If a Background-Image Loaded Successfully ... AFTER The Fact?
            Asked 2022-Jan-13 at 12:56

            There are several Stack Overflow questions like How can I check if a background image is loaded? which are similar to mine. They attempt to run code when an element's background-image loads, and accomplish this by adding an onload handler to the element.

            But what if you are running (for instance) a Puppeteer script, which checks the page after it has already loaded? In that case you can't add onload handlers.

            Is there any way to verify that the background-image of an element loaded, "after the fact", without using onload?

            The only way I can think of is to grab their background-image style, then fetch the image myself to see if it loads ... but that seems a lot slower than just asking the browser (somehow) if the image loaded ... especially if I'm checking a lot of background-images.



            Answered 2021-Sep-02 at 16:17

            Puppeteer has a config for pages to check the number of idle connections. So the images should be loaded while there are no more requests than specified in 500ms.

            Source https://stackoverflow.com/questions/69033777


            Puppeteer not working NodeJS 17 on Arch Linux
            Asked 2021-Nov-28 at 07:25

            I've started working with Puppeteer and for some reason I cannot get it to work on my box. This error seems to be a common problem (SO1, SO2) but all of the solutions do not solve this error for me. I have tested it with a clean node package (see reproduction) and I have taken the example from the official Puppeteer 'Getting started' webpage.

            How can I resolve this error?

            Versions and hardware ...


            Answered 2021-Nov-24 at 18:42

            There's too much for me to put this in a comment, so I will summarize here. Maybe it will help you, or someone else. I should also mention this is for RHEL EC2 instances behind a corporate proxy (not Arch Linux), but I still feel like it may help. I had to do the following to get puppeteer working. This is straight from my docs, but I had to hand-jam the contents because my docs are on an intranet.

            I had to install all of these libraries manually. I also don't know what the Arch Linux equivalents are. Some are duplicates from your question, but I don't think they all are:
            pango libXcomposite libXcursor libXdamage libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 alsa-lib atk gtk3 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc liberation-mono-fonts liberation-narrow-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts glib2

            If Arch Linux uses SELinux, you may also have to run this:
            setsebool -P unconfirmed_chrome_sandbox_transition 0

            It is also worth adding dumpio: true to your options to debug. Should give you a more detailed output from puppeteer, instead of the generic error. As I mentioned in my comment. I have this option ignoreDefaultArgs: ['--disable-extensions']. I can't tell you why because I don't remember. I think it is related to this issue, but also could be related to my corporate proxy.

            Source https://stackoverflow.com/questions/70032857


            Puppteer cannot open shared object file libxshmfence.so.1
            Asked 2021-Nov-22 at 02:09

            While executing the puppeteer script on ubuntu (VERSION="20.04.2 LTS (Focal Fossa)") server I am getting this error because of some missing peer dependencies (I think).

            Thanks already



            Answered 2021-Nov-22 at 02:09

            node_modules/puppeteer/.local-chromium/linux-XXXXXX/chrome-linux/chrome needs shared library libxshmfence.so.1.

            Run the following command to install libxshmfence.so.1.

            Source https://stackoverflow.com/questions/68646577


            Angular 6 to 12 Migration: Getting Multiple Warning: Css Minimizer Plugin: > Unexpected "$"
            Asked 2021-Nov-19 at 17:27

            After migrating my angular 6 project to 12. I am getting multiple warning in terminal

            if in angular.json i set optimisation: false configuration then all issue get resolved but i don't want to make this changes it should be true only.

            with optimisation: true i am getting all these warnings:-

            Earlier same code was working fine without any warning.



            Answered 2021-Sep-08 at 10:30

            I had the same problem. You should change the import of 'assets/.../variables.scss' to './assets/.../variables.scss'. In my case it was in styles.scss but it can be in every .scss file.

            Source https://stackoverflow.com/questions/69040951


            Is there a flag to disable subresource integrity checking in chromium?
            Asked 2021-Oct-13 at 17:23

            We're using puppeteer and sometimes playwright to run some integration tests. We mock some of the target page's script dependencies, which causes subresource integrity hash mismatches.



            Answered 2021-Oct-13 at 17:23

            No. I believe the only way is to fix or remove the integrity attribute from the source that loads the script.

            Looking at the chromium (or blink) source, unless the integrity attribute is empty, the FetchManager::Loader will instantiate the SRIVerifier, whose constructor calls its OnStateChange method, where for response types of basic, cors, default (leaving out opaque responses and errors), SubresourceIntegrity::CheckSubresourceIntegrity is called. Unless the parsing of the integrity attribute fails, SubresourceIntegrity::CheckSubresourceIntegrityImpl will either successfully verify one of the digests, or it will fail with the given error message. There is no configuration option checked along this path to override a failed check.

            Source https://stackoverflow.com/questions/69470528


            docker-compose: failed to solve: rpc error: code = Unknown desc = failed to compute cache key
            Asked 2021-Sep-30 at 09:52

            When I run my dockerfile with docker build and docker run, it's working great. But when I create a docker-compose.yml file to connect mongoDB I got an Error.

            ERROR: failed to solve: rpc error: code = Unknown desc = failed to compute cache key: failed to walk /var/lib/docker/tmp/buildkit-mount285447202/backend: lstat /var/lib/docker/tmp/buildkit-mount285447202/backend: no such file or directory.

            Here my docker-compose code:



            Answered 2021-Sep-30 at 09:52

            This usually happens when the Dockerfile can't find the folder, e.g.


            Source https://stackoverflow.com/questions/69389685


            Puppeteer cannot write in a specific input field
            Asked 2021-Sep-18 at 15:35

            I tried to write in the search field (input) with Puppeteer but the program ends without writing anything in that field. Here the code:



            Answered 2021-Sep-18 at 15:35

            The input element is inside hidden element. You need to unhide the parent element first:

            Source https://stackoverflow.com/questions/69235275

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install puppeteer

            To use Puppeteer in your project, run:. Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, download into another path, or download a different browser, see Environment variables.


            Check out contributing guide to get an overview of Puppeteer development.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • npm

            npm i puppeteer

          • CLONE
          • HTTPS


          • CLI

            gh repo clone puppeteer/puppeteer

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link