skip to Main Content

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


  1. 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

    Login or Signup to reply.
  2. 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:

    lighthouse-batch -s https://www.url1.com,https://www.url2.com,https://www.url3.com
    

    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 file site_url.json

    Login or Signup to reply.
  3. 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:

    npx lighthouse-parade http://www.dfwfreeways.com/
    

    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 🙂

    Login or Signup to reply.
  4. 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.

    Login or Signup to reply.
  5. …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:

    module.exports = {
      ci: {
        collect: {
          url: [
           'https://www.nytimes.com',
           'https://www.nytimes.com/interactive/2023/03/12/sports/natural-selection-snowboarding-travis-rice.html'
          ],
         // ...
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search