new Scraper(username, password, refreshLoginTimer, dataRefreshTimer)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
username |
string | Username for sunnyportal | |
password |
string | Password | |
refreshLoginTimer |
number | time until login is refreshed in seconds | |
dataRefreshTimer |
number | 5 | data update interval in seconds |
- Source:
Methods
(async) destroy() → {Promise.<void>}
Call to destroy the browser instance.
- Source:
Returns:
resolves when destroyed
- Type
- Promise.<void>
getData() → (nullable) {SunnyData}
get data
- Source:
Returns:
- Type
- SunnyData
(async) login() → {Promise.<void>}
Performs login or relog on page.
- Source:
Returns:
- Type
- Promise.<void>
(async) setup(headless, args) → {Promise.<void>}
Setups the scraper. Needs to be called once.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
headless |
boolean | true | True for headless operation. |
args |
Array | args for chromium |
- Source:
Returns:
- Type
- Promise.<void>
(async) start()
Starts retrieving data
- Source:
stop()
Stops retrieving data
- Source: