-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump.py
More file actions
23 lines (23 loc) · 961 Bytes
/
Copy pathdump.py
File metadata and controls
23 lines (23 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import asyncio
from playwright.async_api import async_playwright
async def run():
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True, args=['--no-sandbox'])
page = await browser.new_page()
await page.goto('https://hub.aeredium.io/community')
await asyncio.sleep(25)
elements = await page.evaluate('''() => {
return Array.from(document.querySelectorAll('*'))
.filter(el => el.innerText && el.innerText.includes('Connect'))
.map(el => ({
tag: el.tagName,
text: el.innerText,
visible: el.offsetWidth > 0 && el.offsetHeight > 0,
classes: el.className
}));
}''')
for el in elements:
if el['visible']:
print(f"{el['tag']} | {el['text']} | {el['classes']}")
await browser.close()
asyncio.run(run())