Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
azizkpln
GitHub Repository: azizkpln/moriarty-project
Path: blob/master/Investigation/socialMedia4.py
193 views
1
import asyncio
2
from playwright.async_api import async_playwright
3
from pyvirtualdisplay import Display
4
import time
5
6
def printAll():
7
return goAc
8
async def run(playwright,phone_number):
9
global page
10
global goAc
11
display = Display(visible=0, size=(1600, 1200))
12
display.start()
13
firefox = playwright.firefox
14
browser = await firefox.launch(headless=True)
15
context = await browser.new_context()
16
page = await context.new_page()
17
await page.goto("https://accounts.google.com/signin/v2/identifier?hl=en-GB&flowName=GlifWebSignIn&flowEntry=ServiceLogin")
18
await page.locator('css=[autocomplete="username"]').fill(phone_number[0])
19
await page.click('button:has-text("Next")')
20
try:
21
22
await page.click("css=[type='checkbox']")
23
goAc="True"
24
except:
25
goAc="False"
26
await browser.close()
27
async def goMain(phone_number):
28
async with async_playwright() as playwright:
29
await run(playwright,phone_number)
30
31
32
33
34
35