Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
azizkpln
GitHub Repository: azizkpln/moriarty-project
Path: blob/master/Investigation/socialMedia3.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 twAc
8
async def run(playwright,phone_number):
9
global page
10
global twAc
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://twitter.com/i/flow/login")
18
19
await page.locator('.r-30o5oe').fill(phone_number[0])
20
await page.click('div.css-18t94o4:nth-child(6)')
21
try:
22
await page.click('span.css-18t94o4:nth-child(1) > span:nth-child(1) > span:nth-child(1)',timeout=5000)
23
twAc="True"
24
except:
25
twAc="False"
26
await browser.close()
27
async def twMain(phone_number):
28
async with async_playwright() as playwright:
29
await run(playwright,phone_number)
30
31
32
33
34
35