Parser Functions


This article lists and explains the available commands within the Parser code for writing a scraper using the IDE.

Commands marked with a star are proprietary functions developed by Bright Data.



Global variable available to the parser code

let url = input.url;



An instance of cheerio

$('#example').text_sane(); /* This is like $().text() but also trims text and replace all space characters with single space "a b \t\n\n c" -> "a b c" */
Find more information on the cheerio website.



A global variable available to the parser code. Object with info about current location

let current_url = location.href; // ""


Collect image data

let i = new Image('');
collect({image: i});


Collect video data

let v = new Video('');
collect({video: v});


Collect price/money data

let p = new Money(10, 'USD');
collect({product_price: p});

Was this article helpful?