fabienvauchelles / scrapoxy

Scrapoxy is a super proxy aggregator, allowing you to manage all proxies in one place 🎯, rather than spreading it across multiple scrapers πŸ•ΈοΈ. It also smartly handles traffic routing πŸ”€ to minimize bans and increase success rates πŸš€.
http://scrapoxy.io
MIT License
1.88k stars 232 forks source link

How to use scrapoxy with chrome headless #174

Closed tuan231195 closed 7 months ago

tuan231195 commented 4 years ago

Hello,

I am trying to use scrapoxy with Chrome headless My config

{
    "commander": {
        "password": "sportywidedev"
    },
    "instance": {
        "port": 3128,
        "scaling": {
            "min": 1,
            "max": 2
        }
    },
    "providers": [
        {
            "type": "awsec2",
            "accessKeyId": "<key>",
            "secretAccessKey": "<secret>",
            "region": "ap-southeast-2",
            "instance": {
                "InstanceType": "t2.micro",
                "ImageId": "ami-03ed5bd63ba378bd8",
                "SecurityGroups": [
                    "forward-proxy"
                ]
            }
        }
    ]
}

My puppeteer code

const browserOptions: LaunchOptions = {
    ignoreHTTPSErrors: true,
    args: [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        `--proxy-server=http://127.0.0.1:8888`,
        '--proxy-bypass-list=127.0.0.1',
        '--proxy-bypass-list=0.0.0.0',
            ],
    executablePath: config.get('puppeteer:executable'),
    ...options,
};

const browser = await puppeteer.launch(browserOptions);

Actual Behavior

It failed with

Error: net::ERR_TUNNEL_CONNECTION_FAILED at https://www.whoscored.com/LiveScores#
    at navigate (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/node_modules/puppeteer-core/lib/FrameManager.js:120:37)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  -- ASYNC --
    at Frame.<anonymous> (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/node_modules/puppeteer-core/lib/helper.js:111:15)
    at Page.goto (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/node_modules/puppeteer-core/lib/Page.js:674:49)
    at Page.<anonymous> (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/node_modules/puppeteer-core/lib/helper.js:112:23)
    at SwPageWrapper.goto (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/packages/sw-data/dist/webpack:/src/core/browser/browser.class.ts:141:19)
    at Proxy.apply (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/packages/sw-data/dist/webpack:/sw-shared/src/lib/utils/object/proxy.ts:18:30)
    at ScoreCrawlerService.navigateTo (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/packages/sw-data/dist/webpack:/src/crawler/score-crawler.service.ts:329:15)
    at ScoreCrawlerService.navigateTo [as getLiveMatches] (/Users/tuannguyen/kho-tai-lieu/Zoolz/Dev/Sporty-Wide/sporty-wide-web/packages/sw-data/dist/webpack:/src/crawler/score-crawler.service.ts:46:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

Specifications

Thanks, Tuan Nguyen

fabienvauchelles commented 9 months ago

Scrapoxy 4.0.0 supports browser (Chrome, Firefox) with TLS MITM natively. Also, there is a stickie session mechanism with cookie injection.

fabienvauchelles commented 7 months ago

Hey there! 🌟 Exciting news! Scrapoxy 4 is ready to rock πŸš€. Check it out at Scrapoxy.io (explore the "get started" guide, deployment documentation, and more πŸ“š). I can't wait to hear your feedback on this new version! Send me your coolest screenshots with as many proxies as possible! πŸ“ΈπŸ’» Join the Discord community if you have any questions or just want to chat. You can also open a GitHub issue for any bug or feature request 🐞✨. See you soon! 😎 Fabien