开发者

Scrape a page with AJAX requests

I'm usin开发者_运维百科g Node.js with jsDOM to scrape web pages and execute JavaScript in them. But if a page contains AJAX requests, they are not executed.

Is there an option to execute AJAX calls inside the scraped pages?


you need to emulate XMLHTTPRequests. Here's an abstraction. They don't work out of the box in node.js.

You will have to figure out how to get it to talk to jsdom. (Hopefully just appending a xmlhttprequest constructor to the window will fix it)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜