How can I run lighthouse for multiple pages/URLs without having to run the lighthouse-ci command multiple times for every single page I want to test/audit?
How I currently run my lighthouse tests for my pages.
lighthouse-ci --performance=80 --seo=80 --accessibility=80 --best-practices=80 <url-1>
lighthouse-ci --performance=80 --seo=80 --accessibility=80 --best-practices=80 <url-2>
lighthouse-ci --performance=80 --seo=80 --accessibility=80 --best-practices=80 <url-3>
5
Answers
instead of cli, you can write a program, where you can read urls from a file
you can use this for reference
https://github.com/gowthamraj198/Lighthouse
I came across the same problem and while looking for a good solution came across this nifty little package – lighthouse-batch
All I had to do was run the following by passing URL’s separated by a comma:
You also get the summary of all the sites passed in a single
summary.json
file as well as a detailed report for each site under the filesite_url.json
I’ve had a lot of luck with Lighthouse Parade, another CLI package. It runs a Lighthouse report on all pages discoverable from the url you provide:
Pro tip: run it at night or give it a limit on the number of pages to run if you’re not familiar with how many pages are on a domain 🙂
I had the exact same issue. So I built a web tool for that: https://qualitycs.dev
It crawls sitemap to find new pages then it runs lighthouse regularly.
Issues are listed per page and globally. Meaning that you can directly see site wise issues such as cache, dans, https etc.
I’m actively working on it so new features are coming.
…chiming in late here, but you’re now able to provide a list of urls in your .lighthouserc configs:
https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md#url
Example: