如何让木偶操纵者不被发现?

kas*_*o99 3 chromium node.js web-scraping puppeteer

我正在尝试使用 puppeteer 抓取超市网站。尽管我希望能够以编程方式进行,但我可以使用 chrome 网络刮板插件来抓取它。我得到的只是一个空白屏幕,页面上没有加载任何内容。

我已经尝试了网络上的所有提示和技巧,使木偶操作者无法被检测到,但没有任何效果。见下文,我设置了许多类似于普通浏览器会话的选项,但似乎没有任何效果。有没有人有任何提示可以帮助我抓取这个网站?

这是我尝试过的代码:

const puppeteer = require('puppeteer');

(async function main() {
    try {

        const args = [
            '--no-sandbox',
            '--disable-setuid-sandbox',
            '--disable-infobars',
            '--window-position=0,0',
            '--ignore-certifcate-errors',
            '--ignore-certifcate-errors-spki-list',
            '--user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3312.0 Safari/537.36"'
        ];

        const options = {
            args,
            headless: false,
            ignoreHTTPSErrors: true,
            userDataDir: './tmp',
            dumpio: true,
            devtools: true
        };

        //launch the browser
        const browser = await puppeteer.launch(options);

        //open new page
        const page = await browser.newPage();

        //set the browser viewport
        await page.setViewport({
            width: 1920,
            height: 1080,
        });

        //set the language to english
        await page.setExtraHTTPHeaders({
            'Accept-Language': 'en'
        });
        //set the URL in a variable
        const url = 'https://shop.coles.com.au/a/a-national/product/vanish-napisan-gold-pro-oxiaction';
        //Go to the page
        await page.goto(url, { "waitUntil": "networkidle2" });
        //get the title
        const productTitle = await page.$eval('span.product-name', el => el.innerText.trim());
        //log the title in the console
        console.log(productTitle);


    } catch (e) {
        console.log('our error', e);
    }

})();
Run Code Online (Sandbox Code Playgroud)

我还应该尝试什么?

pgu*_*rio 5

它正在发布到指纹脚本。

因此,您需要以某种方式拦截并更改它。

查尔斯