Path: blob/master/Investigation/socialMedia1.py
193 views
import asyncio1from playwright.async_api import async_playwright2from pyvirtualdisplay import Display3import time4def printAll():5return faceAc6async def run(playwright,phone_number):7global page8global faceAc910firefox = playwright.firefox11browser = await firefox.launch(headless=True)12context = await browser.new_context()13page = await context.new_page()14await page.goto("https://www.facebook.com/login/")15await page.locator('css=[placeholder="Email address or phone number"]').fill(phone_number[0])16await page.locator('css=[placeholder="Password"]').fill(phone_number[0])17await page.click("#loginbutton")18try:19try:20await page.text_content('div:has-text("incorrect.")')21faceAc="True"22except:23try:24await page.text_content('div:has-text("invalid")')25faceAc="True"26except:27faceAc="False"28except:29faceAc="False"30print(faceAc)31await browser.close()3233async def faceMain(phone_number):34async with async_playwright() as playwright:35await run(playwright,phone_number)36373839