puppeteer-real-browser
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "puppeteer-real-browser", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js", |
133
README.md
@@ -0,1 +1,6 @@ | ||
[](https://scrape.do/?utm_source=github&utm_medium=repo_prb) | ||
> [!WARNING] | ||
> This repo will no longer receive updates. Thank you to everyone who supported it. | ||
<br/> | ||
@@ -21,3 +26,2 @@ <p align="center"> | ||
<p align="center"> | ||
@@ -39,3 +43,2 @@ <img src="https://img.shields.io/github/contributors/zfcsoftware/puppeteer-real-browser?color=dark-green" alt="Contributors" /> | ||
```bash | ||
@@ -51,4 +54,2 @@ npm i puppeteer-real-browser | ||
## Include | ||
@@ -59,17 +60,15 @@ | ||
```js | ||
const { connect } = require('puppeteer-real-browser'); | ||
const { connect } = require("puppeteer-real-browser"); | ||
const start = async () => { | ||
const { page, browser } = await connect() | ||
} | ||
const { page, browser } = await connect(); | ||
}; | ||
``` | ||
``` | ||
### Module | ||
```js | ||
import { connect } from "puppeteer-real-browser"; | ||
import { connect } from 'puppeteer-real-browser' | ||
const { page, browser } = await connect() | ||
const { page, browser } = await connect(); | ||
``` | ||
@@ -79,36 +78,30 @@ | ||
```js | ||
const { connect } = require("puppeteer-real-browser"); | ||
const { connect } = require("puppeteer-real-browser") | ||
async function test() { | ||
const { browser, page } = await connect({ | ||
headless: false, | ||
const { browser, page } = await connect({ | ||
args: [], | ||
headless: false, | ||
customConfig: {}, | ||
args: [], | ||
turnstile: true, | ||
customConfig: {}, | ||
connectOption: {}, | ||
turnstile: true, | ||
connectOption: {}, | ||
disableXvfb: false, | ||
ignoreAllFlags: false | ||
// proxy:{ | ||
// host:'<proxy-host>', | ||
// port:'<proxy-port>', | ||
// username:'<proxy-username>', | ||
// password:'<proxy-password>' | ||
// } | ||
}) | ||
await page.goto('<url>') | ||
disableXvfb: false, | ||
ignoreAllFlags: false, | ||
// proxy:{ | ||
// host:'<proxy-host>', | ||
// port:'<proxy-port>', | ||
// username:'<proxy-username>', | ||
// password:'<proxy-password>' | ||
// } | ||
}); | ||
await page.goto("<url>"); | ||
} | ||
test() | ||
test(); | ||
``` | ||
@@ -127,3 +120,3 @@ | ||
**disableXvfb:** In Linux, when headless is false, a virtual screen is created and the browser is run there. You can set this value to true if you want to see the browser. | ||
**disableXvfb:** In Linux, when headless is false, a virtual screen is created and the browser is run there. You can set this value to true if you want to see the browser. | ||
@@ -133,2 +126,3 @@ **ignoreAllFlags** If true, all initialization arguments are overridden. This includes the let's get started page that appears on the first load. | ||
## How to Install Puppeteer-extra Plugins? | ||
Some plugins, such as puppeteer-extra-plugin-anonymize-ua, may cause you to be detected. You can use the plugin installation test in the library's test file to see if it will cause you to be detected. | ||
@@ -143,26 +137,22 @@ | ||
```js | ||
const test = require("node:test"); | ||
const assert = require("node:assert"); | ||
const { connect } = require("puppeteer-real-browser"); | ||
const test = require('node:test'); | ||
const assert = require('node:assert'); | ||
const { connect } = require('puppeteer-real-browser'); | ||
test('Puppeteer Extra Plugin', async () => { | ||
const { page, browser } = await connect({ | ||
args: ["--start-maximized"], | ||
turnstile: true, | ||
headless: false, | ||
// disableXvfb: true, | ||
customConfig: {}, | ||
connectOption: { | ||
defaultViewport: null | ||
}, | ||
plugins: [ | ||
require('puppeteer-extra-plugin-click-and-wait')() | ||
] | ||
}) | ||
await page.goto("https://google.com", { waitUntil: "domcontentloaded" }) | ||
await page.clickAndWaitForNavigation('body') | ||
await browser.close() | ||
}) | ||
test("Puppeteer Extra Plugin", async () => { | ||
const { page, browser } = await connect({ | ||
args: ["--start-maximized"], | ||
turnstile: true, | ||
headless: false, | ||
// disableXvfb: true, | ||
customConfig: {}, | ||
connectOption: { | ||
defaultViewport: null, | ||
}, | ||
plugins: [require("puppeteer-extra-plugin-click-and-wait")()], | ||
}); | ||
await page.goto("https://google.com", { waitUntil: "domcontentloaded" }); | ||
await page.clickAndWaitForNavigation("body"); | ||
await browser.close(); | ||
}); | ||
``` | ||
@@ -176,3 +166,2 @@ | ||
```bash | ||
@@ -190,3 +179,2 @@ git clone https://github.com/zfcsoftware/puppeteer-real-browser | ||
```bash | ||
@@ -200,3 +188,2 @@ docker run puppeteer-real-browser-project | ||
## Quick Questions and Answers | ||
@@ -206,3 +193,3 @@ | ||
This problem is probably caused by the runtime being closed by the rebrowser used. | ||
This problem is probably caused by the runtime being closed by the rebrowser used. | ||
https://github.com/zfcsoftware/puppeteer-real-browser/tree/access-window | ||
@@ -212,15 +199,19 @@ I created a branch for this. You can access the value you want by adding javascript to the page source with puppeteer-intercept-and-modify-requests as done in success.js. If you know about the Chrome plugin, you can also use it. | ||
### page.setViewport method is not working, what should I do? | ||
As with the initialization arguments in the test module, you can set the defaultViewport in connectOption. If you set null, it will take up as much space as the width of the Browser. | ||
### Does the library have any known detection problems? | ||
using puppeteer-core patched with rebrowser. Tested with the challenging sites in the test file in headless false mode and passed with flying colors. The only known issue is that the mouse screeenX does not match the mouse position. This has been patched in the library. | ||
### Does the library have any known detection problems? | ||
using puppeteer-core patched with rebrowser. Tested with the challenging sites in the test file in headless false mode and passed with flying colors. The only known issue is that the mouse screeenX does not match the mouse position. This has been patched in the library. | ||
The ghost-cursor is included in the library. (https://github.com/zfcsoftware/puppeteer-real-browser/blob/2a5fba37a85c15625fb3c8d1f7cf8dcb109b9492/lib/cjs/module/pageController.js#L54) You can use ghost-cursor with page.realCursor. page.click It is recommended to use page.realClick instead of page.click. | ||
### What Makes This Library Special? | ||
This library lets you launch and use Chrome in its most natural state. It tries to get the best results with minimal patching. Thanks to @nwebson who fixed the Runtime.enable issue from this point. If using rebrowser solves your problem, I don't recommend using real browser. | ||
This library lets you launch and use Chrome in its most natural state. It tries to get the best results with minimal patching. Thanks to @nwebson who fixed the Runtime.enable issue from this point. If using rebrowser solves your problem, I don't recommend using real browser. | ||
Real browser does not give you full control over launching. It launches Chrome with Chrome launcher and connects to it with rebrowser. | ||
### Why can't I pass Recaptcha v3? | ||
https://stackoverflow.com/questions/52546045/how-to-pass-recaptcha-v3 | ||
@@ -238,6 +229,6 @@ | ||
* **rebrowser™** - [rebrowser™](https://github.com/rebrowser) - *Created a patch pack for Runtime, which left many traces behind. Since Runtime was not used, most problems were solved. TargetFilter, which was used in the past and caused many problems, was switched to this patch. The Puppeteer-core library was patched and added to this repo. A lot of good bot detection systems are not caught thanks to rebrowser. Please star the rebrowser repo. Thank you. (https://github.com/rebrowser/rebrowser-patches)* | ||
- **rebrowser™** - [rebrowser™](https://github.com/rebrowser) - _Created a patch pack for Runtime, which left many traces behind. Since Runtime was not used, most problems were solved. TargetFilter, which was used in the past and caused many problems, was switched to this patch. The Puppeteer-core library was patched and added to this repo. A lot of good bot detection systems are not caught thanks to rebrowser. Please star the rebrowser repo. Thank you. (https://github.com/rebrowser/rebrowser-patches)_ | ||
* **Skill Issue™** - [TheFalloutOf76](https://github.com/TheFalloutOf76) - *He realized that mouse movements could not be simulated accurately and created a solution for this. His solution is used in this library. (https://github.com/TheFalloutOf76/CDP-bug-MouseEvent-.screenX-.screenY-patcher)* | ||
- **Skill Issue™** - [TheFalloutOf76](https://github.com/TheFalloutOf76) - _He realized that mouse movements could not be simulated accurately and created a solution for this. His solution is used in this library. (https://github.com/TheFalloutOf76/CDP-bug-MouseEvent-.screenX-.screenY-patcher)_ | ||
## Disclaimer of Liability | ||
@@ -251,2 +242,2 @@ | ||
By using this software, you agree to this disclaimer. | ||
By using this software, you agree to this disclaimer. |
476574
17
229