Path: blob/master/Investigation/socialMedia4.py
193 views
import asyncio1from playwright.async_api import async_playwright2from pyvirtualdisplay import Display3import time45def printAll():6return goAc7async def run(playwright,phone_number):8global page9global goAc10display = Display(visible=0, size=(1600, 1200))11display.start()12firefox = playwright.firefox13browser = await firefox.launch(headless=True)14context = await browser.new_context()15page = await context.new_page()16await page.goto("https://accounts.google.com/signin/v2/identifier?hl=en-GB&flowName=GlifWebSignIn&flowEntry=ServiceLogin")17await page.locator('css=[autocomplete="username"]').fill(phone_number[0])18await page.click('button:has-text("Next")')19try:2021await page.click("css=[type='checkbox']")22goAc="True"23except:24goAc="False"25await browser.close()26async def goMain(phone_number):27async with async_playwright() as playwright:28await run(playwright,phone_number)29303132333435