R
R
ratatyq2016-04-22 17:41:39
JavaScript
ratatyq, 2016-04-22 17:41:39

How to parse dynamic (AJAX) data on a website using jquery node js?

Hello, the question arose how to parse dynamic data from the site (they are taken from the ajax request)? At first I did it in such a way that I connected to the site through request, downloaded it in this way and tried to find the data I needed ... it didn’t work, then I just output the entire site to the console and got that div but there was nothing in it, although on the site itself there is data in this div block (they are just dynamic), the implementation is more interested in Jquery and not in Phantom js * (well, I didn’t really understand it, and I’m too lazy to figure it out). Thanks in advance for your reply.)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VZVZ, 2016-04-22
@VZVZ

What side is jQuery here? Well, there is an on dom change event somewhere in JS, but why, if you abandoned PhantomJS?
Learn to work with pure HTTP requests. In particular, fake the AJAX request you want. To do this, the Fiddler sniffer will help, it will track it, and you can form and send it from Node.js or any other desktop PL, and receive data.

Y
Yuri Shilka, 2016-04-24
@glitch536

A browser engine like phantom is needed to emulate browser events. With the help of the engine, you put a handler on the desired event and intercept it - just like in a real browser. You can also execute your code directly in the browser console - this means forgoing node js to intercept links. You can unravel the algorithm for building the necessary links and construct them manually. You can look at node libraries like jsdom - they are simpler than phantom, but I'm not sure if they do what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question