Skip to content

Instantly share code, notes, and snippets.

@allatambov
Created Mar 16, 2022
Embed
What would you like to do?
from selenium import webdriver as wd
# enter your path here
br = wd.Chrome("/Users/allat/Downloads/chromedriver")
br.get("https://vk.com/")
login = br.find_element_by_id("index_email")
login.send_keys("allatambov@mail.ru")
password = br.find_element_by_id("index_pass")
# enter your password here
password.send_keys("")
go = br.find_element_by_id("index_login_button")
go.click()
br.get("https://vk.com/friends")
search = br.find_element_by_link_text("Поиск друзей")
search.click()
pars = br.find_element_by_id("friends_filters_block")
pars.click()
cnt = br.find_element_by_id("cCountry")
cnt_inp = cnt.find_element_by_tag_name("input")
cnt_inp.send_keys("Россия")
from selenium.webdriver.common.keys import Keys
cnt_inp.send_keys(Keys.RETURN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment