I'm using the following code to fetch URLs of pages, basically what I'm trying to do is allowing my users to add products through their links they paste a link , the application is suppoused to fetch the link, get the images and create a new product using the data.
fetch(url, headers)
.then(response => response.text())
.then(text => {
resolve(this._parseResponse(text, url));
})
.catch(error => reject({ error }));
I then parse it through cheerio.
However I noticed that some websites like Nike and Newegg doesn't return the same result expected when using browser or normal curl command.
Nike returns "Access Denied", and Newegg returns "404".
Any fixes for that or any other suggestion to how may I achieve my goal?
Thanks.