initial commit
This commit is contained in:
commit
71dc98ef33
35
import.py
Normal file
35
import.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
"""
|
||||||
|
Script to search by a list of emails, best run interactively
|
||||||
|
"""
|
||||||
|
import time
|
||||||
|
from selenium import webdriver
|
||||||
|
from selenium.webdriver.common.keys import Keys
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
|
||||||
|
with open("/~/Downloads/not_voted.txt", encoding="utf-8") as file:
|
||||||
|
emails = [l.strip() for l in file.readlines()]
|
||||||
|
|
||||||
|
driver = webdriver.Firefox()
|
||||||
|
# driver.get('https://SITE.nationbuilder.com/admin/signups')
|
||||||
|
|
||||||
|
for i, email in enumerate(emails[100:150]):
|
||||||
|
driver.find_elements(By.ID, "criteria")[-1].click()
|
||||||
|
time.sleep(0.05)
|
||||||
|
add_criteria = driver.find_elements(By.CSS_SELECTOR, ".select2-search")[
|
||||||
|
-1
|
||||||
|
].find_element(By.TAG_NAME, "input")
|
||||||
|
add_criteria.send_keys("email")
|
||||||
|
add_criteria.send_keys(Keys.RETURN)
|
||||||
|
time.sleep(0.05)
|
||||||
|
parent = driver.find_element(By.CSS_SELECTOR, ".criteria-list")
|
||||||
|
parent.find_elements(By.TAG_NAME, "input")[-1].send_keys(email)
|
||||||
|
print(i)
|
||||||
|
|
||||||
|
i = 2
|
||||||
|
e = 150
|
||||||
|
parent = driver.find_element(By.CSS_SELECTOR, ".criteria-list")
|
||||||
|
for email in emails[e : e + 150]:
|
||||||
|
parent.find_elements(By.TAG_NAME, "input")[i].clear()
|
||||||
|
parent.find_elements(By.TAG_NAME, "input")[i].send_keys(email)
|
||||||
|
i += 3
|
||||||
|
print(i)
|
Loading…
Reference in New Issue
Block a user