1.0.6 • Published 1 year ago

@airporting/scrap-tools v1.0.6

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

scrap-tools

Usage

const browser = await puppeteer.launch({...});
const context = await browser.createIncognitoBrowserContext();
const page = await context.newPage();

const {
  screenshot,
  click,
  fill,
  wait
} = require('@airporting/scrap-tools')(page);

Typings

Typings of this module are available at root of this package.

Methods

When term selector is used above, it refers to well known CSS selectors : https://developer.mozilla.org/fr/docs/Web/CSS/CSS_Selectors

Click

await click('selector');

Will wait for selector and will try to click on it.

Fill

 await fill('selector', value_as_string);

Will wait for selector and will try to fill with value.

Screenshot

 await screenshot('name');

Will take a screenshot of current page and will name it belongs to name argument. Will store it into root folder screenshot. You need to create it manually before. If not exists, will crash your script.

Screenshot

 await screenshot('name');

Will take a screenshot of current page and will name it belongs to name argument. Will store it into root folder screenshot. You need to create it manually before. If not exists, will crash your script.

Wait

 await wait([timeout]);

Will just wait for time passed as argument (optionnal). Default to 2 000 ms.

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago