Cherrio axios csrf

Viewed 17

How can I accept CSRF token?

I need to parse one page Atėjo metas atlaisvinti vietos spintoje? But I cannot accept the CSRF
token. I use Axios and Cherrio.

const axios = require('axios');
const cheerio = require('cheerio');

(async () => {
  try {
    const response = await axios.get('https://www.vinted.lt/', {
        headers: {
            'cache-control': 'max-age=0',
            'referer': 'https://google.com',
            'upgrade-insecure-requests': '1',
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36',
  }
    });
    console.log(response);
    const $ = cheerio.load(response.data);
    console.log($('seller-promotion__content-title').html());
  } catch (error) {
    console.log(error);
  }
})();

0 Answers
Related