sunnyportal-scraper

1.0.11 • Public • Published

Sunnyportal Scraper

NPM

NodeJS library to retrieve information on PV plants from the Sunnyportal.
Documentation can be found here. An example file is included here

Usage

Import the library and instantiate a new Scraper.

const Scraper = require("sunnyportal-scraper");
const scraper = new Scraper('username', 'password');

Parameters for all operations can be found in the docs.
Setup the scraper. This operation is asynchronous.

await scraper.setup(false); 

Additional parameters can be specified, especially if chromium doesnt run. Refer to puppeteer troubleshooting.

await scraper.setup(false, ['--no-sandbox', '--disable-setuid-sandbox']);

To start the loop that updates the data:

await scraper.start();
 
// Retrieve data
let data = scraper.getData();

After your application has finished, close the browser instance

await scraper.destroy();

Tests

Tests can be run using Mocha. Username and password have to be provided using environment variables.

SUNNY_USER = username
SUNNY_PASS = password

Package Sidebar

Install

npm i sunnyportal-scraper

Weekly Downloads

5

Version

1.0.11

License

MIT

Unpacked Size

1.07 MB

Total Files

41

Last publish

Collaborators

  • orli