Answer the question
In order to leave comments, you need to log in
How to change the privacy settings on VK?
You need to close messages, that is, in the privacy settings, select "who can write me private messages" in the menu - no one.
The API does not have this, of course.
If everything is simple with other privacy settings -
url = 'https://m.vk.com/settings?act=privacy&privacy_edit=status_replies'
s = requests.session ()
#тут код для авторизации
data = s.get(url, headers=headers, proxies=proxies)
page = lxml.html.fromstring(data.content)
form = page.forms[0]
form.fields['val'] = 3
s.post('https://m.vk.com/' + form.action, headers=headers, proxies=proxies, data=form.form_values())
Answer the question
In order to leave comments, you need to log in
In short, since no one answered, I solved the problem like this.
How to use authorization proxy in Selenium with Firefox in Python? - here in this topic I read how to fasten a proxy with authorization to selenium, and more specifically to phantomJS.
Here through it I will change the privacy settings.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question