Actor picture

Har Files For Url List

apify/har-files-for-url-list

Generates a HTTP Archive (HAR) file for web pages specified in a list of URLs. Optionally, the pages can be loaded using proxies from a specific country - to use this feature, you'll need access to Apify Proxy. On input, the actor accepts JSON object with the following fields: - sourceUrls: An array specifying which web pages to load. The format is same as the 'source' parameter of the RequestList in Apify SDK for Node.js. It can combined URLs as well as a link to a CSV file with the list of URLs. - country: Optional country code On output, the actor stores the resulting HAR files to the run's default key-value store, and also stores a table into the dataset with information about each web page visited and a link to the corresponding HAR file, or description of errors.

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const Apify = require('apify');

// Set API token
Apify.client.setOptions({ token: '<YOUR_API_TOKEN>' });

// Prepare actor input
const input = {};

// Run the actor
const run = await Apify.call('apify/har-files-for-url-list', input);

// Print actor output (if any)
console.log('Output');
console.dir(run.output);

// Fetch and print actor results from the run's dataset (if any)
console.log('Results from dataset');
const dataset = await Apify.openDataset(run.defaultDatasetId);
await dataset.forEach(async (item, index) => {
    console.log(JSON.stringify(item));
});
  • Modified
  • Last run
  • Used106 times
  • Used by11 users
Categories