This file contains 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 | |
import requests | |
import time | |
pageurl = 'https://www.google.com/recaptcha/api2/demo' | |
driver = webdriver.Chrome(executable_path=r'chromedriver_win32\chromedriver.exe') | |
driver.get(pageurl) |
This file contains 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
site_key = "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" | |
with open(r"api_key.txt", "r") as f: | |
api_key = f.read() | |
form = {"method": "userrecaptcha", | |
"googlekey": site_key, | |
"key": api_key, | |
"pageurl": pageurl, | |
"json": 1} |
This file contains 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
url = f"http://2captcha.com/res.php?key={api_key}&action=get&id={request_id}&json=1" | |
status = 0 | |
while not status: | |
res = requests.get(url) | |
if res.json()['status']==0: | |
time.sleep(3) | |
else: | |
requ = res.json()['request'] | |
js = f'document.getElementById("g-recaptcha-response").innerHTML="{requ}";' |
This file contains 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 __future__ import print_function | |
import pickle | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
# If modifying these scopes, delete the file token.pickle. | |
SCOPES = ['https://www.googleapis.com/auth/gmail.send'] | |
PATH = r"PATH_TO_JSON" |
This file contains 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 base64 | |
import pickle | |
from email.mime.text import MIMEText | |
from googleapiclient.discovery import build | |
def create_message(sender, to, subject, message_text): | |
"""Create a message for an email. | |
Args: | |
sender: Email address of the sender. |