Skip to content

Instantly share code, notes, and snippets.

@nebula1989
nebula1989 / twitter.py
Last active July 22, 2020 17:45
Click Twitter Topics and Click Follow Buttons
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Firefox()
browser.maximize_window()
browser.get('https://twitter.com/i/flow/topics_selector')
@nebula1989
nebula1989 / captcha.py
Created July 24, 2020 14:22
Psuedo code of how to interact with captcha, or continue on if not there
driver.get("yourUrl.com")
while True:
try:
captcha_box = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "captchaBox"))
)
# process the captcha however way you do
@nebula1989
nebula1989 / auto_tr_public.py
Created October 27, 2020 19:18
a script to automatically do a few tasks like assigning cases, filling in forms, clicking, and responding and closing certain cases.
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# selenium exceptions
from selenium.common.exceptions import \
# Profile Model. Which is linked to the built in django auth user library
class Profile(models.Model):
# 1 user gets 1 profile page
user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
profile_url = models.URLField(max_length=200, default=('profile/' + str(User.username)))
life_story = models.TextField(max_length=500, default="My Life Story")
class Meta:
db_table = 'Profile'
verbose_name = "Profile"