How can I specify xhr request with node.js + cheerio?

Smit

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

Peter Lyons

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How can I specify the required Node.js version in package.json?

From Dev

Can I load a local html file with the cheerio package in node.js?

From Dev

Can I / how do I explicitly terminate a long running xhr request?

From Dev

How do I get an element name in cheerio with node.js

From Dev

How can I get the http request headers actually sent by me in node.js http request

From Dev

Can I specify RabbitMQ credentials in node.js?

From Dev

node js cheerio xml

From Dev

Incremental and non-incremental urls in node js with cheerio and request

From Dev

How to put scraping content to html (Node.js, cheerio)

From Dev

How can I set a timeout for a zmq request in Node.js?

From Dev

How can i send a webcal request with node.js?

From Dev

Can I specify es6 inside node js file

From Dev

How to use XHR API in Node.js?

From Dev

How to get element one by one using node.js Cheerio

From Dev

AngularJS $http request not getting detect as xhr in Node JS Express

From Dev

How can i return an XML file corresponding to a URL request in node.js?

From Dev

How can I add "namespace" to request in node soap

From Dev

how to test cheerio js

From Dev

How can I generate a signed request for Product Advertising API URL in Node.js

From Dev

How can I specify xhr request with node.js + cheerio?

From Dev

How can I get the http request headers actually sent by me in node.js http request

From Dev

Incremental and non-incremental urls in node js with cheerio and request

From Dev

How can I specify optional request parameters for a Grails command object?

From Dev

How can I install node.js?

From Dev

Scraping links from website using Node.js, request, and cheerio?

From Dev

In Node js. How many simultaneous requests can I send with the "request" package

From Dev

How can I make node js synchronize?

From Dev

node traverse using cheerio js

From Dev

Node JS request and cheerio HTML-Page error

Related Related

  1. 1

    How can I specify the required Node.js version in package.json?

  2. 2

    Can I load a local html file with the cheerio package in node.js?

  3. 3

    Can I / how do I explicitly terminate a long running xhr request?

  4. 4

    How do I get an element name in cheerio with node.js

  5. 5

    How can I get the http request headers actually sent by me in node.js http request

  6. 6

    Can I specify RabbitMQ credentials in node.js?

  7. 7

    node js cheerio xml

  8. 8

    Incremental and non-incremental urls in node js with cheerio and request

  9. 9

    How to put scraping content to html (Node.js, cheerio)

  10. 10

    How can I set a timeout for a zmq request in Node.js?

  11. 11

    How can i send a webcal request with node.js?

  12. 12

    Can I specify es6 inside node js file

  13. 13

    How to use XHR API in Node.js?

  14. 14

    How to get element one by one using node.js Cheerio

  15. 15

    AngularJS $http request not getting detect as xhr in Node JS Express

  16. 16

    How can i return an XML file corresponding to a URL request in node.js?

  17. 17

    How can I add "namespace" to request in node soap

  18. 18

    how to test cheerio js

  19. 19

    How can I generate a signed request for Product Advertising API URL in Node.js

  20. 20

    How can I specify xhr request with node.js + cheerio?

  21. 21

    How can I get the http request headers actually sent by me in node.js http request

  22. 22

    Incremental and non-incremental urls in node js with cheerio and request

  23. 23

    How can I specify optional request parameters for a Grails command object?

  24. 24

    How can I install node.js?

  25. 25

    Scraping links from website using Node.js, request, and cheerio?

  26. 26

    In Node js. How many simultaneous requests can I send with the "request" package

  27. 27

    How can I make node js synchronize?

  28. 28

    node traverse using cheerio js

  29. 29

    Node JS request and cheerio HTML-Page error

HotTag

Archive