Document how an array of urls interacts with the puppeteerScript flag
See original GitHub issueHi!
I’ve been trying to set up a puppeteer-script to bypass authentication. However, I am having some trouble figuring out how the puppeteerScript flag interacts with the URL list I have. lighthouserc.json
"puppeteerScript": "puppeteer-login-script.js",
"url": [
"http://127.0.0.1:8181/",
"http://127.0.0.1:8181/about",
"http://127.0.0.1:8181/contact",
"http://127.0.0.1:8181/donate",
"http://127.0.0.1:8181/get-started",
"http://127.0.0.1:8181/community-library",
"http://127.0.0.1:8181/privacy-policy",
"http://127.0.0.1:8181/teach",
"http://127.0.0.1:8181/terms",
"http://127.0.0.1:8181/thanks"
]
},
I can get it to work with one URL, but I think my config currently runs the Puppeteer script before each URL collection and keeps trying to log in even though I am already logged in. Is there a way I make it so that the lighthouserc
config will only run the script on certain URLs. Or do I need to handle it in the puppeteer-login-script
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Puppeteer documentation - DevDocs
Puppeteer is a Node library which provides a high-level API to control Chromium or Chrome over the DevTools Protocol. The Puppeteer API is...
Read more >Crawling multiple URLs in a loop using Puppeteer
I have an array of URLs to scrape data ...
Read more >Web Performance Recipes With Puppeteer - Addy Osmani
This guide has recipes for automating Web Performance measurement with Puppeteer.
Read more >How To Build a Concurrent Web Scraper with Puppeteer ...
In this tutorial, you will use Node.JS, Puppeteer, Docker, and Kubernetes to build a highly scalable scraper that can simultaneously extract ...
Read more >Build a Link Previewer with Puppeteer & Serverless Functions
vue file, we're basically using a demoLinks array of links to render a list of LinkPreviewer components, which we pass to the targetURL...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A snippet in the docs near the description of
puppeteerScript
option would be great, or perhaps even a complete configuration example in the “Examples” section? A recipe feels like overkill here.When using puppeteer, the browser is kept open across all URLs so if you’re keeping state in
cookies
then everything should be remembered between URLs. If you’re using anything other than cookies though, you might have trouble. There’s no real way to supportsessionStorage
because new tabs are created and other storage types are cleared by Lighthouse in between runs so you’ll need to use--collect.settings.disableStorageReset
as well.Basic flow with puppeteer script.
This shouldn’t be the case. You can definitely use a custom config along with puppeteer. What gave you this impression?
This is what happens 😃
Do you have suggestions on how to improve the documentation for this setting? AFAICT, it offers nearly that identical JSDoc of what the parameters and structure are so I’m not sure how to make it any clearer 😕