Skip to content

Instantly share code, notes, and snippets.

@swt02026
Created November 12, 2020 06:28
Show Gist options
  • Save swt02026/80d32382c3635d6ef8f416cea2b69482 to your computer and use it in GitHub Desktop.
Save swt02026/80d32382c3635d6ef8f416cea2b69482 to your computer and use it in GitHub Desktop.
from playwright import sync_playwright
import io
import time
with sync_playwright() as p:
rand_file = io.FileIO("accupass", 'w')
writer = io.BufferedWriter(rand_file, buffer_size=100000000)
for browser_type in [p.chromium]:
browser = browser_type.launch()
page = browser.newPage()
for i in range(180):
url = f'https://old.accupass.com/search/r/1/0/10101/99991231/0/{i}/00010101/99991231'
page.goto(url)
for j in page.querySelectorAll('.apcss-activity-card-title'):
writer.write((j.innerText() + '\n').encode())
writer.flush()
for i in range(20):
url = f'https://old.accupass.com/search/r/2/0/10101/99991231/0/{i}/00010101/99991231'
page.goto(url)
for j in page.querySelectorAll('.apcss-activity-card-title'):
writer.write((j.innerText() + '\n').encode())
writer.flush()
time.sleep(0.3)
browser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment