Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
azizkpln
GitHub Repository: azizkpln/moriarty-project
Path: blob/master/Investigation/FindOwner2.py
193 views
1
import asyncio
2
from playwright.async_api import async_playwright
3
from pyvirtualdisplay import Display
4
import time
5
async def GoogleMail(email,password):
6
await page2.fill("#identifierId",email)
7
await page2.click("#identifierNext > div > button > span",timeout=3000)
8
await page2.locator("#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input").fill(password)
9
await page2.locator("#passwordNext > div > button > span").click()
10
await page2.locator("#submit_approve_access > div > button > div.VfPpkd-RLmnJb").click()
11
async def getName():
12
global name
13
try:
14
name = await page.text_content("#__next > section.SearchDataSection_searchData___2rxeV > div.NumberDetailsCard_card___2vSQO.SearchDataSection_searchData__card___2yyUr.NumberDetailsCard_card__info___SGTrb > div > div > div.NumberDetailsCard_card__head___3dM4Q > div.NumberDetailsCard_card__name____58-0",timeout=3000)
15
except:
16
try:
17
await page.text_content("#__next > section.SearchDataSection_searchData___2rxeV > div.NumberDetailsCard_card___2vSQO.SearchDataSection_searchData__card___2yyUr.NumberDetailsCard_card__overLimit___1aZPG > div > div > div.NumberDetailsCard_card__head___3dM4Q > div.NumberDetailsCard_card__name____58-0 > div",timeout=3000)
18
name="exceeded"
19
except:
20
try:
21
await page.text_content("#__next > section.SearchDataSection_searchData___2rxeV > div.NumberDetailsCard_card___2vSQO.SearchDataSection_searchData__card___2yyUr.NumberDetailsCard_card__noInfo___wOyaL > div > div > div.NumberDetailsCard_card__head___3dM4Q > div.NumberDetailsCard_card__name____58-0",timeout=3000)
22
name="UnKnown"
23
except:
24
name="Update Required. Please contact with developer."
25
def printName():
26
return name
27
async def run(playwright,phone_number,email,password):
28
global page,page2
29
display = Display(visible=0, size=(1600, 1200))
30
display.start()
31
firefox = playwright.firefox
32
browser = await firefox.launch(headless=True)
33
context = await browser.new_context()
34
page = await context.new_page()
35
await page.goto("https://sync.me/")
36
await page.locator('css=[placeholder="Search any phone number"]').fill(phone_number)
37
await page.keyboard.press("Enter")
38
time.sleep(1)
39
async with context.expect_page() as new_page_info:
40
await page.click("p.NumberDetailsCard_button___3FEkC:nth-child(1)")
41
page2 = await new_page_info.value
42
await page2.wait_for_load_state()
43
time.sleep(2)
44
await GoogleMail(email,password)
45
await getName()
46
await browser.close()
47
async def main1(phone_number,email,password):
48
async with async_playwright() as playwright:
49
await run(playwright,phone_number,email,password)
50
51