Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.6 kB
2
Indexable
Never
from selenium.webdriver.common.keys import Keys 
from selenium.webdriver.common.by import By 
from selenium import webdriver 
from time import sleep 
email = ''  # your email 
password = ''  # your password 
phone = ''  # your phone or user name 
 
extension_path = "Chrome-SetupVPN-3.12.16.crx" 
 
options = webdriver.ChromeOptions() 
options.add_extension(extension_path) 
 
driver = webdriver.Chrome(options=options) 
 
driver.get('https://twitter.com/i/flow/login') 
sleep(5) 
 
email_xpath = '/html/body/div/div/div/div[1]/div/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div/div/div/div[5]/label/div/div[2]/div/input' 
email_input = driver.find_element(By.XPATH, email_xpath) 
email_input.click() 
email_input.send_keys(email) 
email_input.send_keys(Keys.RETURN) 
 
sleep(5) 
phone_xpath = '/html/body/div/div/div/div[1]/div/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div[2]/label/div/div[2]/div/input' 
phone_input = driver.find_element(By.XPATH, phone_xpath) 
phone_input.send_keys(phone) 
phone_input.send_keys(Keys.RETURN) 
 
sleep(5) 
pass_xpath = '/html/body/div/div/div/div[1]/div/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div/div[3]/div/label/div/div[2]/div[1]/input' 
pass_input = driver.find_element(By.XPATH, pass_xpath) 
pass_input.send_keys(password) 
pass_input.send_keys(Keys.RETURN) 
sleep(10) 
 
search_xpath = '/html/body/div[1]/div/div/div[2]/header/div/div/div/div[1]/div[2]/nav/a[2]' 
search = driver.find_element(By.XPATH, search_xpath) 
search.send_keys(Keys.ENTER) 
sleep(10) 
 
searchbar_xpath = '/html/body/div[1]/div/div/div[2]/main/div/div/div/div/div/div[1]/div[1]/div/div/div/div/div/div[1]/div[2]/div/div/div/form/div[1]/div/div/div/label/div[2]/div/input' 
searchbar = driver.find_element(By.XPATH, searchbar_xpath) 
searchbar.send_keys('@PlayVALORANT') 
searchbar.send_keys(Keys.RETURN) 
sleep(5) 
 
valorant_xpath = '/html/body/div[1]/div/div/div[2]/main/div/div/div/div/div/div[3]/div/section/div/div/div[3]/div/div/div/div/div[2]/div[1]/div[1]/div/div[1]/a' 
Valo = driver.find_element(By.XPATH, valorant_xpath) 
Valo.send_keys(Keys.ENTER) 
sleep(10) 
 
following_link = '/html/body/div[1]/div/div/div[2]/main/div/div/div/div/div/div[3]/div/div/div/div/div[5]/div[1]/a' 
driver.find_element(By.XPATH, following_link).click() 
sleep(5) 
 
following = '/html/body/div[1]/div/div/div[2]/main/div/div/div/div/div/section/div/div/div[{j}]/div/div/div/div/div[2]/div[1]/div[1]/div/div[1]/a/div/div[1]/span/span[1]' 
for i in range(1, 19): 
    print(driver.find_element(By.XPATH, following.format(j=i)).text)