Path: blob/master/Investigation/socialMedia3.py
193 views
import asyncio1from playwright.async_api import async_playwright2from pyvirtualdisplay import Display3import time45def printAll():6return twAc7async def run(playwright,phone_number):8global page9global twAc10display = 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://twitter.com/i/flow/login")1718await page.locator('.r-30o5oe').fill(phone_number[0])19await page.click('div.css-18t94o4:nth-child(6)')20try:21await page.click('span.css-18t94o4:nth-child(1) > span:nth-child(1) > span:nth-child(1)',timeout=5000)22twAc="True"23except:24twAc="False"25await browser.close()26async def twMain(phone_number):27async with async_playwright() as playwright:28await run(playwright,phone_number)29303132333435