alien
alien

Reputation: 51

Lighthouse Multiple URLs

There's a website I need to do a full audit on, but I'm wondering if there's any way to make Lighthouse do it. I know they don't support full site audits or multiple URLs, but I found out that it could maybe be done with using bash scripts. So I would appreciate any help on this case! Or maybe any Lighthouse alternatives you'd recommend?

Thank you in advance!

Upvotes: 5

Views: 8224

Answers (5)

Nowadays it can be achieved using lhci, a tool to automate accessibility reports with Lighthouse and optionally store it in a dedicated server.

Lhci has the collect command that runs for multiple urls if provided.

lhci autorun --collect.url=http://example-1.com --collect.url=http://example-2.com

or creating a file lighthouserc.js

{
  "ci": {
    // ...,
    "collect": {
      "url": ["http://example-1.com", "http://example-2.com"]
    }
  }
}

Taken from this Github issue: https://github.com/GoogleChrome/lighthouse-ci/issues/124

Upvotes: 0

Sam Dutton
Sam Dutton

Reputation: 15279

Shameless self promotion, but I wrote the Multihouse Node app to run Lighthouse for multiple URLs.

The app takes URLs and optional metadata from an input CSV file (one row per URL), runs one or more audits, and outputs median scores to an output CSV file.

You can specify multiple different options from the command line.

For example:

  • The number of times Lighthouse is run for each URL. The default is three.
  • Whether to calculate the average or median scores for all the runs. The default is median.
  • Which Lighthouse audits to run. The default is all audits: Performance, Best practice, PWA, Accessibility, SEO.
  • Whether to include results for all individual audits or for Web Vitals.

You might also want to take a look at Related projects on the Lighthouse GitHub repo.

Upvotes: 0

Carr
Carr

Reputation: 2771

In my company, we wanted to collect website's performance data on most of the pages on our landing website, app product, and also our rivals' product, so sometimes there are hundreds of URLs that need to be audited.

I created a tool:

lighthouse-batch-parallel

which could audit multiple URLs. You can get the report result in JS Object, JSON, CSV stream, or you can just use the provided cli-tool to generate the report in .csv or .json.

Upvotes: 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 by under the file site_url.json

Upvotes: 2

Yo Wakita
Yo Wakita

Reputation: 5450

It is possible to audit multiple URLs,as long as you loop over some array of urls programatically. I suggest first launching your chrome instance with chromeLauncher, then either launchings chrome for each url and writing results to some result directory in parallel, or do the same action but sequentially. When you have received the results from all of the urls, kill the chrome launcher and node process.

Upvotes: 0

Related Questions