Release Format

response_format: string | 'html';

What's This?

The response_format option lets you choose how you want to see the data after the scraper fetches it from a website. You can either get the raw webpage content or a more organized, detailed breakdown.

How Does it Work?

  • Default (response_format=’html’): The scraper gives you the content of the website just as you'd see it in a web browser.

  • response_format=’json’:Instead of just the content, the scraper provides a neatly organized report. This report can include the website's content, details about the request, any extra information if you used the (debug=true) option, and how much data was used.

When Should I Use This?

If you just want the content of a website, stick with the default. But if you're looking for a more detailed view or want to process the data further, choose the json format.

Methods

setResponseFormat(string) 

Configuration Name: setResponseFormat

Initializing Scraper

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

Using Method

scraper.setResponseFormat('json');
scraper.scrape('https://example.com/');

Using Configuration Object

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