pageres | Capture website screenshots

 by   sindresorhus TypeScript Version: 8.0.0 License: MIT

kandi X-RAY | pageres Summary

kandi X-RAY | pageres Summary

pageres is a TypeScript library. pageres has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Type: number (Seconds) Default: 0. Delay capturing the screenshot. Useful when the site does things after load that you want to capture. Type: number (Seconds) Default: 60. Number of seconds after which the request is aborted. Type: boolean Default: false. Crop to the set height. Apply custom CSS to the webpage. Specify some CSS or the path to a CSS file. Apply custom JavaScript to the webpage. Specify some JavaScript or the path to a file. Type: Array. A string with the same format as a browser cookie or an object. Tip: Go to the website you want a cookie for and copy-paste it from DevTools. Type: string Default: '<%= url %>-<%= size %><%= crop %>'. Define a customized filename using Lo-Dash templates. For example: <%= date %> - <%= url %>-<%= size %><%= crop %>. Type: boolean Default: false. When a file exists, append an incremental number. Capture a specific DOM element matching a CSS selector. Hide an array of DOM elements matching CSS selectors. Username for authenticating with HTTP auth. Password for authenticating with HTTP auth. Type: number Default: 1. Scale webpage n times. Type: string Default: png Values: 'png' | 'jpg'. Custom HTTP request headers. Type: boolean Default: false. Set background color to transparent instead of white if no background is set. Type: boolean Default: false. Emulate preference of dark color scheme. Type: object Default: {}. Options passed to puppeteer.launch(). The specified function is called right before the screenshot is captured, as well as before any bounding rectangle is calculated as part of options.element. It receives the Puppeteer Page instance as the first argument and the browser instance as the second argument. This gives you a lot of power to do custom stuff. The function can be async. Note: Make sure to not call page.close() or browser.close().
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pageres has a medium active ecosystem.
              It has 9548 star(s) with 781 fork(s). There are 172 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 19 open issues and 323 have been closed. On average issues are closed in 214 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of pageres is 8.0.0

            kandi-Quality Quality

              pageres has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              pageres is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pageres releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 14 lines of code, 0 functions and 5 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 pageres
            Get all kandi verified functions for this library.

            pageres Key Features

            No Key Features are available at this moment for pageres.

            pageres Examples and Code Snippets

            No Code Snippets are available at this moment for pageres.

            Community Discussions

            QUESTION

            How to specify x509 certificate for Azure SDK in Golang
            Asked 2022-Feb-28 at 10:28

            I am trying to connect to use the Azure SDK for Golang to download files from a container online to my device and am using the connection string provided from azure to connect. For context this is running on a version of embedded Linux

            I have two questions, first how do I pass a specific certificate to the azure SDK to use to connect, as currently when I connect, I get this issue

            Get "https://transaction.blob.core.windows.net/transactions?comp=list&restype=container": x509: certificate signed by unknown authority

            or failing that how do I generate the correct certificate to put it in /etc/ssl? Which I think is where go is looking for certificates as far as I understand.

            Also second question what function from the azure sdk for go should I be using to download from a blob online if my folder structure looks like /transaction/my-libs/images/1.0.0/libimage.bin where transaction is my blob container.

            ...

            ANSWER

            Answered 2022-Feb-28 at 10:28

            • You can use the following Azure SDK for Go command for passing a specific certificate to the Azure SDK to connect to other Azure resources by creating a service principal for it: -

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

            QUESTION

            GET request is sent twice in express JS
            Asked 2021-Oct-14 at 15:25

            I have a loop, that is making 19 calls to a GET url.

            ...

            ANSWER

            Answered 2021-Oct-14 at 15:25

            It appears you are accessing the URL twice, once with:

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

            QUESTION

            nlohmann json parse error at memory location
            Asked 2021-Aug-24 at 21:40

            I'm making a C++ program that will (eventually) take some information from each page on an api endpoint and then add each page to an array. I'm using cpr as my requests library which is fetching the pages correctly as I need them and then I'm using nlohmann's json library to parse the json page result and then use it later on.

            My code:

            ...

            ANSWER

            Answered 2021-Aug-24 at 21:40

            QUESTION

            Tablesorter appears to be running twice for column selection
            Asked 2021-Aug-14 at 14:55

            I've been using Mottie's excellent fork of Tablesorter for years. I'm running across a problem I've never seen before, and I'm not sure where to start hunting for the issue.

            All functions are working correctly, but when I click the Column button, it displays 'auto' twice, and pulls in things that are not columns. In the image below, the items with red underlines are not part of the headers. They are greyed out and can't be touched. I have no idea where they are coming from.

            The headers are derived from a dynamic entry set, pasted below. Not sure this is relevant, but I'm posting the code in case it helps:

            ...

            ANSWER

            Answered 2021-Aug-14 at 14:55

            I truly love this library, it is fantastic. Thank you @Mottie.

            I learned how to utilize the debug function and saw nearly 100 errors like the following:

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

            QUESTION

            UnhandledPromiseRejectionWarning: TypeError: object is not iterable... when using await Promise.all(promises);
            Asked 2020-Oct-13 at 23:22

            I'm trying to generate PNG asynchronously with NodeJS.

            ...

            ANSWER

            Answered 2020-Oct-13 at 23:22

            The promises in generatePNGs is not actually an Array, it's a Promise. You can await it, but you should probably just remove async from generateAnnualPNG.

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

            QUESTION

            pass graphql data from parent to child in gatsby.js
            Asked 2020-Aug-17 at 09:48

            for the sake of not repeating my self, I want to make a component like this

            ...

            ANSWER

            Answered 2020-Aug-17 at 09:48

            I found the answer by working on minimal repro.

            the components look like this :

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

            QUESTION

            Unable to scrape despite IP rotation
            Asked 2020-Jun-27 at 16:40

            I need to scrape this page (the ads): https://www.sahibinden.com/en/cars/used?date=1day&a5_min=2005&a5_max=2020

            When I open it too many times I get blocked, changing the IP doesn't help either. The problem is that when I open this page from browser from my PC it works just fine. But it seems to get blocked from webkit.

            ...

            ANSWER

            Answered 2020-Jun-27 at 16:40

            In their Terms of Use §4.11 they state that it is not allowed to scrape their content:

            The use of the whole or any part of the "Portal" for [...] Automatic program on the site, robot, spider, web crawler , spider, data mining, data crawling etc. "screen scraping" software or systems, using automated tools or manual processes, [...] such uses will be prevented at the discretion of the OWNER. [...]

            So you can be sure they are doing their best to prevent scraping.

            There are methods to workaround the blocks, I advise you to read Thomas Dondorf's great answer on the topic of headless browsers and blocking by reCaptcha. I also strongly recommend to consider his first option in the current case:

            Option 1: Stop crawling or try to use an official API. As the owner of the page does not want you to crawl that page, you could simply respect that decision and stop crawling. Maybe there is a documented API that you can use.

            In general there can be huge differences in scraper recognition between visiting the site in headless vs headful mode, using slowMo option of launch() or not.

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

            QUESTION

            How to add custom headers in Playwright
            Asked 2020-Jun-27 at 11:51
            headers["user-agent"] = fakeUa();
              console.log(fakeUa())
              let firstReq = true;
                page.route('**/*', route => {
                const request = route.request()
                //console.log(request.url(), JSON.stringify(request.headers()));
                
                if("x-j3popqvx-a" in request.headers()){
                    headers = request.headers();
                    //console.log(headers);
                    console.log("exiting");
                    return;
                }
                else {
                    console.log("in");
                    return route.continue({headers: headers});
                }
              });
              let pageRes = await page.goto(url, {waitUntil: 'load', timeout: 0});
            
            ...

            ANSWER

            Answered 2020-Jun-27 at 11:51

            While in puppeteer it was possible with the page.setUserAgent() method to apply a custom UA and page.setExtraHTTPHeaders() to set any custom headers, in playwright you can set custom user agent (userAgent) and headers (extraHTTPHeaders) as options of browser.newPage() or browser.newContext() like:

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

            QUESTION

            Is it possible to use EJS without routes with nodeJS / Express
            Asked 2020-Jun-26 at 15:24

            I'm running a NodeJS script that will generate several PDF reports.

            Thing is I need to generate several graph for each PDFs, so after several problems, I decided to generate graphs in PNG format, then, make the html page including images. From the HTML, I generate a PDF.

            Thing is I don't really need routes, but I need EJS, and I need req / res to generate my graphs:

            ...

            ANSWER

            Answered 2020-Jun-26 at 15:24

            I hope I understand your task correctly. I made an example of a program that starts using the command line, receives the command line arguments meterId and week, generates a .html file from the .ejs template. I also used the yargs package to easily parse command line arguments.

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

            QUESTION

            be aware of the end of a loop of threads in NodeJS
            Asked 2020-May-29 at 07:48

            I have to generate images in my NodeJS app, using Pageres

            I do it in a loop. So, I have 2 options:

            Option 1:

            ...

            ANSWER

            Answered 2020-May-29 at 07:48

            You can use Promise.all() for this purpose. You'll need to return a Promise from makePngScreenShot, which is a minor modification, and also call makePngScreenShot from an async function.

            This would look something like so:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install pageres

            Note to Linux users: If you get a "No usable sandbox!" error, you need to enable system sandboxing.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

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

            Find more libraries
            Install
          • npm

            npm i pageres

          • CLONE
          • HTTPS

            https://github.com/sindresorhus/pageres.git

          • CLI

            gh repo clone sindresorhus/pageres

          • sshUrl

            git@github.com:sindresorhus/pageres.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular TypeScript Libraries

            developer-roadmap

            by kamranahmedse

            vscode

            by microsoft

            angular

            by angular

            TypeScript

            by microsoft

            ant-design

            by ant-design

            Try Top Libraries by sindresorhus

            awesome

            by sindresorhusShell

            refined-github

            by sindresorhusTypeScript

            got

            by sindresorhusTypeScript

            pure

            by sindresorhusShell

            type-fest

            by sindresorhusTypeScript