const request = require('request');
const axios = require('axios');
axios({
method: 'GET',
url: 'https://yandex.ru/',
headers:{
"Accept": "application/json, text/javascript, */*; q=0.01",
"Accept-Language": "ru",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Cookie": '',
"DNT": "1",
"Host": "yandex.ru",
"Pragma": "no-cache",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36",
"X-Requested-With": "XMLHttpRequest",
}
}).then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
request({
url,
method: "GET",
"gzip": true,
headers: {
"Accept": "application/json, text/javascript, */*; q=0.01",
"Accept-Language": "ru",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Cookie": ``,
"DNT": "1",
"Host": "yandex.ru",
"Pragma": "no-cache",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36",
"X-Requested-With": "XMLHttpRequest",
}
}, (err, _res, body) => {
console.log(err)
console.log(err, _res.statusCode, body)
})
import requests
url = "https://yandex.ru/"
HEADERS = {
"Accept": "application/json, text/javascript, */*; q=0.01",
"Accept-Language": "ru",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Cookie": '',
"DNT": "1",
"Host": "yandex.ru",
"Pragma": "no-cache",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36",
"X-Requested-With": "XMLHttpRequest",
}
resp = requests.request("GET", url, headers=HEADERS)
print(resp)
print(resp.json())
Я про то что делаю два одинаковых запроса с node js и python
Абсолютно одинаковых
И только в nodejs капча
Вопрос в том как nodejs палится и как это избежать?