Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import selenium.webdriver as webdriver
- from selenium.webdriver.common.by import By
- from selenium.webdriver.common.keys import Keys
- from selenium.webdriver.chrome.options import Options
- from selenium.webdriver.chrome.service import Service
- url = "https://www.vk.com/login"
- chrome_driver_path = "E://PyCharm_Community_Edition_2023.3.2//scripts//chromedriver//chromedriver"
- service = Service(chrome_driver_path)
- chrome_options = Options()
- chrome_options.add_argument("--no-sandbox")
- chrome_options.add_argument("--disable-dev-shm-usage")
- chrome_options.add_argument("--disable-gpu")
- chrome_options.add_argument("--window-size=1920,1080")
- driver = webdriver.Chrome(service=service, options=chrome_options)
- try:
- driver.get(url=url)
- time.sleep(10)
- email_input = driver.find_element(By.ID, "index_email")
- email_input.clear()
- email_input.send_keys("89958832335")
- time.sleep(3)
- enter = driver.find_element(By.XPATH, "/html/body/div[10]/div/div/div[2]/div[2]/div[3]/div/div[1]/form/button/span/span")
- enter.click()
- time.sleep(4)
- password = driver.find_element(By.XPATH, "/html/body/div[1]/div/div/div/div/div[1]/div[2]/div/div/div/form/div[1]/div[3]/div/div/input")
- password.send_keys("Uekmrf1354")
- time.sleep(4)
- enter = driver.find_element(By.XPATH, "/html/body/div[1]/div/div/div/div/div[1]/div[2]/div/div/div/form/div[2]/button[1]/span[1]/span/span")
- enter.click()
- time.sleep(4)
- enter = driver.find_element(By.XPATH, "/html/body/div[11]/div/div/div[2]/div[1]/div/div[1]/div/div/nav/ol/li[3]/a/span/span")
- enter.click()
- time.sleep(4)
- enter = driver.find_element(By.XPATH, "/html/body/div[11]/div/div/div[2]/div[2]/div[3]/div/div/div/div[2]/ul/div[1]/div[1]/div/div[1]/li[3]/div[2]/div/div[2]/div[1]")
- enter.click()
- time.sleep(4)
- chat = driver.find_element(By.XPATH, "/html/body/div[11]/div/div/div[2]/div[2]/div[3]/div/div/div/div[3]/div[2]/div[4]/div[4]/div[4]/div[1]/div[4]")
- chat.send_keys("Расписание")
- chat.send_keys(Keys.ENTER)
- time.sleep(5)
- chat.send_keys("ИКБО-21-22")
- chat.send_keys(Keys.ENTER)
- time.sleep(10)
- except Exception as ex:
- print(ex)
- finally:
- driver.close()
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement