I
I
Igor Mitrakov2018-03-04 23:42:21
Python
Igor Mitrakov, 2018-03-04 23:42:21

How to parse VK?

I use the Grab library to parse music from VK.

from grab import Grab

page = Grab(log_file = 'out.html')


page.go('https://vk.com')
page.set_input_by_id('quick_email','login')
page.set_input_by_id('quick_pass', 'passwd')
page.submit()
print(page.response.url)

page.go("https://vk.com/audiosUSER_ID")
print(page.response.url)


page.go("https://vk.com/search?c[q]=Feduk&c[section]=audio&c[performer]=1")

page.submit('button class', 'blind_label _audio_row__play_btn')

I can log in, go to the audio search page, but I can’t get a link to the audio file. I tried to track the structure of the link in order to form a request, but as I understand it, the links are encrypted and a JS script is loaded to decrypt the link.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asd111, 2018-03-05
@igormitrakov

Links are encrypted. More details here:
https://habrahabr.ru/post/340810/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question