AJAX is typically indicated via the X-Requested-With header in the request.
request({
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
url: ...})
Try that and see if it does the trick.
Pregunta
The page I'm scrapping is detecting whether the request is ajax or simple one. How can I specify that ?
app.get('/gsb', function(res, req){
request({
method: 'POST',
url: "https://www.somesite.com/somepage/"
} ...
Now, this somepage
detects whether its xhr or not.
Thanks
Solución
AJAX is typically indicated via the X-Requested-With header in the request.
request({
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
url: ...})
Try that and see if it does the trick.