26 lines
999 B
Python
26 lines
999 B
Python
import re
|
|
import sys
|
|
from playwright.sync_api import sync_playwright, Playwright
|
|
|
|
def run(playwright: Playwright):
|
|
print("running")
|
|
webkit = playwright.webkit
|
|
browser = webkit.launch()
|
|
context = browser.new_context(
|
|
viewport={ 'width': 390, 'height': 844 }
|
|
)
|
|
page = context.new_page()
|
|
BASEURL = "https://walmart.northpass.com/app/courses/"
|
|
USERID = "?uid=7beg87y4-fh24-4929-3rt5-24kdn87s5241"
|
|
COURSEID = sys.argv[1]
|
|
print(COURSEID)
|
|
print(USERID)
|
|
example = page.goto(f"{BASEURL}{COURSEID}{USERID}")
|
|
page.screenshot(path="/Users/normrasmussen/Downloads/screenshot1.png", full_page=True)
|
|
page.locator('#course-mobile > div.np-top-cta.stick-to-bottom > a').click()
|
|
page.screenshot(path="/Users/normrasmussen/Downloads/screenshot2.png").mask(['#activity-b4be181e-d2ea-46f8-bb1a-cd316c590fcf > div.Wrapper-h8th5y-0.evldAo.footer__wrapper > div > footer'])
|
|
browser.close()
|
|
|
|
with sync_playwright() as playwright:
|
|
run(playwright)
|