installed deps, got the initial page returning

This commit is contained in:
j37hr0 2026-05-09 17:24:37 +12:00
parent df2b38dc99
commit 3f6148ef81
4 changed files with 19 additions and 2 deletions

0
.gitignore vendored Normal file → Executable file
View file

5
README.md Normal file → Executable file
View file

@ -1,2 +1,7 @@
# AkahuSync # AkahuSync
make sure to install playwright, then run:
```
install playwright --with-deps
```
to get the correct drivers and dependencies for the host system

0
emoneyscraper/main.py Normal file → Executable file
View file

16
emoneyscraper/scraper.py Normal file → Executable file
View file

@ -1,11 +1,23 @@
from playwright.sync_api import sync_playwright, Playwright from playwright.sync_api import sync_playwright, Playwright
import os
from dotenv import load_dotenv
load_dotenv()
def run(playwright: Playwright): def run(playwright: Playwright):
chromium = playwright.chromium # or "firefox" or "webkit". chromium = playwright.chromium # or "firefox" or "webkit".
browser = chromium.launch() browser = chromium.launch()
page = browser.new_page() page = browser.new_page()
page.goto("http://example.com") response = page.goto(os.getenv("URL"))
# other actions... # print(response.status)
# print(response.url)
# print(response.ok)
#page.fill("input#ctl00_ContentPlaceHolder1_txtLoginID", os.getenv("USERNAME"))
#page.fill("input#ctl00_ContentPlaceHolder1_txtPassword", os.getenv("PASSWORD"))
#page.click("input#ctl00_ContentPlaceHolder1_btnLogin")
#
print(page.content())
browser.close() browser.close()
with sync_playwright() as playwright: with sync_playwright() as playwright: