Actor picture

Web Scraper Experimental Debug

mtrunkat/web-scraper-experimental-dbgr

Experimental version of Apify Web Scraper with Chrome debugger integrated

No credit card required

Author's avatarMarek Trunkát
  • Modified
  • Users17
  • Runs400
Actor picture
Web Scraper Experimental Debug

Start URLs

startUrls

Required

array

URLs to start with

Use request queue

useRequestQueue

Optional

boolean

Request queue enables recursive crawling and the use of Pseudo-URLs, Link selector and context.enqueueRequest().

Pseudo-URLs

pseudoUrls

Optional

array

Pseudo-URLs to match links in the page that you want to enqueue. Combine with Link selector to tell the scraper where to find links. Omitting the Pseudo-URLs will cause the scraper to enqueue all links matched by the Link selector.

Link selector

linkSelector

Optional

string

CSS selector matching elements with 'href' attributes that should be enqueued. To enqueue urls from tags, you would enter div.my-class. Leave empty to ignore all links.

Keep URL fragments

keepUrlFragments

Optional

boolean

URL fragments (the parts of URL after a #) are not considered when the scraper determines whether a URL has already been visited. This means that when adding URLs such as https://example.com/#foo and https://example.com/#bar, only the first will be visited. Turn this option on to tell the scraper to visit both.

Page function

pageFunction

Required

string

Function executed for each request

jQuery

injectJQuery

Optional

boolean

The jQuery library will be injected into each page. If the page already uses jQuery, conflicts may arise.

Underscore

injectUnderscore

Optional

boolean

The Underscore.js library will be injected into each page. If the page already uses Underscore.js (or other libraries that attach to '_', such as Lodash), conflicts may arise.

Proxy configuration

proxyConfiguration

Optional

object

Choose to use no proxy, Apify Proxy, or provide custom proxy URLs.

Initial cookies

initialCookies

Optional

array

The provided cookies will be pre-set to all pages the scraper opens.

Use Chrome

useChrome

Optional

boolean

The scraper will use a real Chrome browser instead of a Chromium masking as Chrome. Using this option may help with bypassing certain anti-scraping protections, but risks that the scraper will be unstable or not work at all.

Use Stealth

useStealth

Optional

boolean

The scraper will apply various browser emulation techniques to match a real user as closely as possible. This feature works best in conjunction with the Use Chrome option and also carries the risk of making the scraper unstable.

Ignore SSL errors

ignoreSslErrors

Optional

boolean

Scraper will ignore SSL certificate errors.

Ignore CORS and CSP

ignoreCorsAndCsp

Optional

boolean

Scraper will ignore CSP (content security policy) and CORS (cross origin resource sharing) settings of visited pages and requested domains. This enables you to freely use XHR/Fetch to make HTTP requests from the scraper.

Download media

downloadMedia

Optional

boolean

Scraper will download media such as images, fonts, videos and sounds. Disabling this may speed up the scrape, but certain websites could stop working correctly.

Download CSS

downloadCss

Optional

boolean

Scraper will download CSS stylesheets. Disabling this may speed up the scrape, but certain websites could stop working correctly.

Max request retries

maxRequestRetries

Optional

integer

Maximum number of times the request for the page will be retried in case of an error. Setting it to 0 means that the request will be attempted once and will not be retried if it fails.

Max pages per run

maxPagesPerCrawl

Optional

integer

Maximum number of pages that the scraper will open. 0 means unlimited.

Max result records

maxResultsPerCrawl

Optional

integer

Maximum number of results that will be saved to dataset. The scraper will terminate afterwards. 0 means unlimited.

Max crawling depth

maxCrawlingDepth

Optional

integer

Defines how many links away from the StartURLs will the scraper descend. 0 means unlimited.

Max concurrency

maxConcurrency

Optional

integer

Defines how many pages can be processed by the scraper in parallel. The scraper automatically increases and decreases concurrency based on available system resources. Use this option to set a hard limit.

Page load timeout

pageLoadTimeoutSecs

Optional

integer

Maximum time the scraper will allow a web page to load in seconds.

Page function timeout

pageFunctionTimeoutSecs

Optional

integer

Maximum time the scraper will wait for the page function to execute in seconds.

Navigation wait until

waitUntil

Optional

array

The scraper will wait until the selected events are triggered in the page before executing the page function. Available events are domcontentloaded, load, networkidle2 and networkidle0. See Puppeteer docs.

Debug log

debugLog

Optional

boolean

Debug messages will be included in the log. Use context.log.debug('message') to log your own debug messages.

Browser log

browserLog

Optional

boolean

Console messages from the Browser will be included in the log. This may result in the log being flooded by error messages, warnings and other messages of little value, especially with high concurrency.

Chrome debugger [experimental]

chromeDebugger

Optional

boolean

Experimental implementation of Chrome debugger. In this mode the scraper will run with single browser on concurrency 1. You can place debugger; into your page function to set up a debugger breakpoint.

Custom data

customData

Optional

object

This object will be available on pageFunction's context as customData.