S
S
skiesx2016-09-05 00:01:30
JavaScript
skiesx, 2016-09-05 00:01:30

How to extract data from a post in VK?

Good time of day everyone. You need to do something like this: 1. A link to a post in VK is transmitted. 2. The code stretches the post data according to the variables that I specify. For example, the name and surname of the person who made the post into one variable, the text of the post into another variable. Then more comments are written to a multidimensional array, they also have - who made the comment, the text of the comment, and perhaps also take the date of creation. Who knows how to do this, or which way to look to do it? Maybe there are some methods in the VK API that will come in handy. I know that you can take the whole page and work with its DOM in JS. I would like to hear if there are any easier options. All this needs to be done in JS. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
F
Fenix957, 2016-09-11
@skiesx

https://vk.com/dev/wall
everything you need is there) and of course it will be better to work through api and not parse the entire page

R
Rou1997, 2016-09-05
@Rou1997

You will have to use PHP or any other server language, such requests to the API cannot be sent from the browser, only from Standalone applications (including servers), but you can already "communicate" with your server through JS.

D
Daniel, 2016-09-05
@daniil46

Try simple_html_dom in PHP

L
lionkka, 2016-09-05
@lionkka

You can write a Selenium +php parser

T
TAnonim, 2016-09-09
@TAnonim

And what's the problem then? We get a response from vk api, decode json into an array, and then you can drag anything along the keys of the associative array.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question