Sunnyportal Scraper
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 = ;const scraper = 'username' 'password';
Parameters for all operations can be found in the docs.
Setup the scraper. This operation is asynchronous.
await scraper;
Additional parameters can be specified, especially if chromium doesnt run. Refer to puppeteer troubleshooting.
await scraper;
To start the loop that updates the data:
await scraperstart; // Retrieve datalet data = scraper;
After your application has finished, close the browser instance
await scraper;
Tests
Tests can be run using Mocha. Username and password have to be provided using environment variables.
SUNNY_USER = username
SUNNY_PASS = password