You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE:** more badges availables in [shields.io](https://shields.io/)
11
+
> Simple & Functional Browser API.
18
12
19
-
> Accessing to browser from the Upside Down
13
+
This module is an API simplification over [Chrome Headless API](https://github.com/GoogleChrome/puppeteer) for do common actions, like take an screenshot.
20
14
21
15
## Install
22
16
@@ -35,23 +29,40 @@ frowser('do something')
35
29
36
30
## API
37
31
38
-
### frowser(input, [options])
32
+
All methods needs a valid `url` as required first argument. The second argument will be `opts` for configure specific method settings.
33
+
34
+
All methods expose an universal `promise`/`callback` interface: If you provide a function as last argument, then the output of the method will be following `callback` style. Otherwise, it returns an `promise`.
35
+
36
+
### .html(url, [options], [cb])
37
+
38
+
It returns the full HTML extracted from the URL.
39
+
40
+
`opts` provided are passed to [page.goto](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options).
41
+
42
+
### .pdf(url, [options], [cb])
43
+
44
+
`opts` provided are passed to [page.goto](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options).
45
+
46
+
Additionally you can setup the CSS media providing `opts.media` (by default it will be `'screen'`). This value will be passed to [page.emulateMedia](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulatemediamediatype).
47
+
48
+
### .screenshot(url, [options], [cb])
49
+
50
+
It takes an screenshot of the URL.
51
+
52
+
`opts` provided are passed to [page.screenshot](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagescreenshotoptions).
39
53
40
-
#### input
54
+
Additionally, you can setup the `device` providing `opts.device` and a valid [deviceDescriptor](https://github.com/GoogleChrome/puppeteer/blob/master/DeviceDescriptors.js).
41
55
42
-
*Required*<br>
43
-
Type: `string`
56
+
It returns an [tmpStream](https://github.com/Kikobeats/create-temp-file2#create-temp-file2), with `path` where the temporal file live and `cleanup`/`cleanupSync` methods for clean the temporal file.
44
57
45
-
Lorem ipsum.
58
+
If you want to customize where tmpStream live, pass [opts.tmpOptions](https://github.com/Kikobeats/create-temp-file2#createtempfileoptions).
46
59
47
-
#### options
60
+
###.text(url, [options], [cb])
48
61
49
-
##### foo
62
+
It returns the text extracted from the URL.
50
63
51
-
Type: `boolean`<br>
52
-
Default: `false`
64
+
`opts` provided are passed to [page.goto](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options).
0 commit comments