@walkit/html-render
Puppeteer wrapper for more convenient work with proxies and random user-agents
Last updated 2 months ago by mvalkov .
MIT · Original npm · Tarball · package.json
$ cnpm install @walkit/html-render 
SYNC missed versions from official npm registry.

Модуль html-render

Функции:

       getPage([options]) // возвращает объект page 
                          // принимает объект options следующего вида:

           const options = {
               randomUserAgent: false || true,
               proxyAddress: "http://1.1.1.1:1111",
               blockImage: false || true,
               blockCss: false || true,
               blockMedia: false || true,
               debugRequest: false || true,
               showBrowser: false || true,
               blockList: ['some url pattern', ...]
           }

      closeRender() // закрывает рендер

Пример использования

const htmlRender = require('@walkit/html-render');

(async () => {

    const page = await htmlRender.getPage({
        randomUserAgent: true,
        proxyAddress: 'http://1.2.3.4:9999',
        blockImages: true,
        blockCss: true,
        blockScript: true,
        blockMedia: true,
        debugRequest: true,
        blockList: [
            'yandex.ru',
            'yastatic.net',
            'googleapis.com',
            'yandex.net',
            'gstatic.com',
            'google.com/maps',
            'owl-carousel/owl.carousel.min.js',
            'revolution/ajax_search.js',
            'bootstrap/js/bootstrap.min.js',
            'revolution/amazoncategory.js'
        ],
        // showBrowser: true
    });
    
    // page используется так же, как и в чистом puppeteer

    console.time('Request time:')
    await page.goto('https://google.com', {
        waitUntil: 'domcontentloaded'
    });
    console.timeEnd('Request time:')

    await page.close();
    await htmlRender.closeRender();
})();

Current Tags

  • 1.0.5                                ...           latest (2 months ago)

6 Versions

  • 1.0.5                                ...           2 months ago
  • 1.0.4                                ...           2 months ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |