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
| 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') |
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
| 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 | |
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 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 \ |
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
| # 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" |