Block Resources

block_resources: boolean | true;

What's This?

When you visit a website, there's a lot happening behind the scenes. The site loads text, pictures, styles (which make the site look pretty), and scripts (which make things interactive). The block_resources option lets you tell the scraper to skip some of these behind-the-scenes items, making the scraping process faster and using less internet data.

How Does it Work?

  • Default (block_resources=false): The scraper gets everything from the website, just like when you visit it in a browser.

  • With (block_resources=true): The scraper skips some items, like images or styles, and only fetches the main content.

When Should I Use This?

Turn on block_resources if you want to get the information from a website quickly and don't need things like images. It's like choosing to read only the main article in a magazine and skipping the ads.

Methods

setBlockResources(boolean) 

Configuration Name: block_resources

Initializing Scraper

const GeonodeScraperApi = require('geonode-scraper-api');
const scraper = new GeonodeScraperApi('<Your_username>', '<Your_password>');

Using Method

scraper.setBlockResources(true);
scraper.scrape('https://example.com/');

Using Configuration Object

const config = { block_resources: true };
scraper.scrape('https://example.com/', config);