B
B
Bobby2018-06-18 07:07:48
Python
Bobby, 2018-06-18 07:07:48

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())

that is, simply through the mobile version.
But with HP, not everything is so simple. The LS also closes in this way, but after a few minutes it opens spontaneously. I don't know what it is, but I tested it on a lot of accounts.
The question is - is it possible to set the privacy settings for messages in VK using python without any selenium (I just couldn’t figure out how to use a proxy with authorization there, everything that is googled doesn’t work for some reason)
Save me, please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bobby Miller, 2018-06-18
Miller

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 question

Ask a Question

731 491 924 answers to any question