Answer the question
In order to leave comments, you need to log in
How to get a full VKontakte page using python?
How to get the code of the page VKontakte (mobile version) in python?
For example, if I just do it something like this:
...
def download_page(self, url):
opener = urllib2.build_opener()
opener.addheaders = [('Cookie', self._cookie),
('User-Agent', self._user_agent),
('Accept-Charset', 'utf-8')]
page = opener.open(url)
page_string = page.read().decode('utf-8')
url = "https://m.vk.com/id1?z=photo1_326502705%2Fphotos1"
print blabla.download_page(url)
...
Answer the question
In order to leave comments, you need to log in
Ajax request - XMLHttpRequest, it can also be created in python. Cookies can also be added to it all the necessary ones. It is also possible to form GET or POST.
Maybe you didn’t know, but an AJAX request is a regular HTTP request, and in the context of the task you need to generate the correct headers, which, to be honest, is problematic, given the VKontakte authentication / authorization mechanisms (although maybe everything is simpler there than I think).
And why not use the VKontakte API and work directly with the data, bypassing the process of stupid html parsing (as I understand it, everything is done for this).
preg_match_all("/(^|\s)один(\s|$)/",$text);
Beginning of line or surrounded by spaces or end of line
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question