Web URL in question: https://www.theroyalamerican.com/schedule
I am building a node.js script to scrape the web page above using the request-promise
package (which grabs the page's html for me). Unfortunately, when I run my code, it gives me a 400 status code from Squarespace (the apparent host of this site).
Strangely, when I browse to the same URL in my web browser, I can pull it up with no problem at all - 200 status code.
I do not have this problem, where my node script and web browser seem to mismatch, with any other web pages. Curious what's going on here...
const rp = require('request-promise');
const $ = require('cheerio');
const url = 'https://www.theroyalamerican.com/schedule';
rp(url)
.then(function(html) {
console.log(html);
})
.catch(function(err) {
console.log(err);
//handle error
});