Vinted Request Blocked in Javascript
I Want to Do Some Requests on the Vinted Website, I Have a Code Python Which Works Perfectly, but the "Same" Code in Javascript Doesn't. Vinted's Cloudflare...
I want to do some requests on the Vinted website, I have a code python which works perfectly, but the "same" code in JavaScript doesn't. Vinted's Cloudflare block the request after 1 request, with the code 1020 (access denied).
I start my script with the command node index.js
Here is the python code
import requests;
headers = requests.utils.default_headers()
headers.update({"User-agent":"Mozilla/5.0"})
response = requests.get("", headers=headers)
print(response)
headers = requests.utils.default_headers()
headers.update({"User-agent":"Mozilla/5.0"})
response = requests.get("", headers=headers)
print(response)
And here the JS one
const config = {
method: 'get',
url: '
headers: {
'User-Agent': 'Mozilla/5.0',
'Accept-Encoding': 'gzip, deflate',
'Accept': '*/*',
'Connection': 'keep-alive'
}
};
axios(config).then(function (response) {
console.log(response);
axios(config).then(function (response) {
console.log(response);
})
})
The Vinted error is
<h1>Access denied</h1>
<p>You do not have access to site owner may have set restrictions that prevent you from accessing the site. Contact the site owner for access or try loading the page again.</p>
<ul class="cferror_details">
<li>Ray ID: 7126ef811e8376e1</li>
<li>Timestamp: 2022-05-28 12:18:54 UTC</li>
<li>Your IP address: X.X.X.X</li>
<li class="XXX_no_wrap_overflow_hidden">Requested URL: </li>
<li>Error reference number: 1020</li>
<li>Server ID: FL_376F42</li>
<li>User-Agent: Mozilla/5.0</li>