antibotbrowser 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,28 @@ const antibotbrowser = require("antibotbrowser");
|
|
|
15
15
|
antibotbrowser = antibotbrowser.startbrowser();
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
## END - Connect the browser to puppeteer with websocket
|
|
19
|
+
```js
|
|
20
|
+
const antibotbrowser = require("antibotbrowser");
|
|
21
|
+
const puppeteer = require('puppeteer');
|
|
22
|
+
|
|
23
|
+
(async () => {
|
|
24
|
+
|
|
25
|
+
const antibrowser = await antibotbrowser.startbrowser();
|
|
26
|
+
|
|
27
|
+
const browser = await puppeteer.connect({browserWSEndpoint: antibrowser.websokcet});
|
|
28
|
+
|
|
29
|
+
// Normal use from now on
|
|
30
|
+
const page = await browser.newPage();
|
|
31
|
+
|
|
32
|
+
await page.setViewport({width:0, height:0});
|
|
33
|
+
|
|
34
|
+
page.goto("https://google.com")
|
|
35
|
+
|
|
36
|
+
})();
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
18
40
|
## Arguments
|
|
19
41
|
```js
|
|
20
42
|
antibotbrowser.startbrowser(port, url);
|
|
@@ -37,7 +59,7 @@ const puppeteer = require('puppeteer');
|
|
|
37
59
|
|
|
38
60
|
const antibrowser = await antibotbrowser.startbrowser(); // We start the browser with default settings. Port: 9222 Url: google.com
|
|
39
61
|
|
|
40
|
-
const browser = await puppeteer.connect({browserWSEndpoint:
|
|
62
|
+
const browser = await puppeteer.connect({browserWSEndpoint: antibrowser.websokcet}); // We connect the launched browser to puppeteer. With the variable we created above, it gives the web socket url to puppetter with antibotbrowser.websocket .
|
|
41
63
|
|
|
42
64
|
// Normal use from now on
|
|
43
65
|
const page = await browser.newPage();
|
|
@@ -57,9 +79,9 @@ const puppeteer = require('puppeteer');
|
|
|
57
79
|
const antibrowser = await antibotbrowser.startbrowser(9222, "https://google.com"); // We start the browser | Port: 9222 Url: google.com
|
|
58
80
|
const antibrowser2 = await antibotbrowser.startbrowser(9223, "https://github.com"); // 2. We create a browser | Port: 9223 Url: google.com
|
|
59
81
|
|
|
60
|
-
const browser = await puppeteer.connect({browserWSEndpoint:
|
|
82
|
+
const browser = await puppeteer.connect({browserWSEndpoint: antibrowser.websokcet}); // We connect the launched browser to puppeteer. With the variable we created above, it gives the web socket url to puppetter with antibotbrowser.websocket .
|
|
61
83
|
|
|
62
|
-
const browser2 = await puppeteer.connect({browserWSEndpoint:
|
|
84
|
+
const browser2 = await puppeteer.connect({browserWSEndpoint: antibrowser2.websokcet}); // 2. We have connected a browser in this way
|
|
63
85
|
|
|
64
86
|
const page2 = await browser2.newPage(); // 2. we opened a new tab in the browser
|
|
65
87
|
// Normal use from now on
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antibotbrowser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"readme": "README.md",
|
|
5
5
|
"description": "Opening Chromium opens a real browser without bot validations in automated systems like Puppetter. To avoid problems in places like Cloudflare",
|
|
6
6
|
"main": "index.js",
|