Created
April 29, 2017 04:22
-
-
Save pettazz/abcd12f761f3f3994d430b3a2e027af8 to your computer and use it in GitHub Desktop.
A great way to run out of memory quick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
from selenium import webdriver | |
TOTAL_WORKERS = 10 | |
TWITTER_USER = 'butts' | |
TWITTER_PASSWORD = 'bu77s' | |
def worker(): | |
driver = webdriver.Chrome() | |
driver.get("http://www.superdeluxe.com/vic") | |
login_link = driver.find_element_by_css_selector("div[class^='style__login'] a") | |
login_link.click() | |
twitter_button = driver.find_elements_by_css_selector("div.modal-body div[class^='style__buttons'] button")[1] | |
twitter_button.click() | |
username = driver.find_element_by_id('username_or_email') | |
username.send_keys(TWITTER_USER) | |
password = driver.find_element_by_id('password') | |
password.send_keys(TWITTER_PASSWORD) | |
login_button = driver.find_element_by_id('allow') | |
login_button.click() | |
time.sleep(10) | |
print "logged in, now blasting that button for America..." | |
button = driver.find_element_by_tag_name('button') | |
while True: | |
button.click() | |
time.sleep(0.1) | |
threads = [] | |
for i in range(TOTAL_WORKERS): | |
t = threading.Thread(target=worker) | |
threads.append(t) | |
t.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment