From 6b802300ec02280228c8e27d901c0c874e269b36 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Fri, 24 Oct 2025 14:54:00 -0400 Subject: [PATCH] Ran Spark script for screenshots. --- Scripts/Walmart/Spark/screenshots_to_pdf.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Scripts/Walmart/Spark/screenshots_to_pdf.py b/Scripts/Walmart/Spark/screenshots_to_pdf.py index 5d2d9227..4b02e2fd 100644 --- a/Scripts/Walmart/Spark/screenshots_to_pdf.py +++ b/Scripts/Walmart/Spark/screenshots_to_pdf.py @@ -6,14 +6,14 @@ import glob import os from datetime import date - +# 2aed7eac-321f-4ba2-9ee8-7f8c90006459 BASEURL = "https://walmart.northpass.com/app/courses/" USERID = "?uid=7beg87y4-fh24-4929-3rt5-24kdn87s5241" COURSEID = sys.argv[1] DIR = "./" def run(playwright: Playwright): - print("running") + print("Launching Playwright") webkit = playwright.webkit browser = webkit.launch() context = browser.new_context( @@ -29,16 +29,17 @@ def run(playwright: Playwright): # Extract all hrefs from the course outline course_links = page.locator('.np-course-outline-content-section a').evaluate_all('elements => elements.map(el => el.href)') - page.screenshot(path=f"{DIR}-{course_name}_{screen_num}.png", full_page=True) + page.screenshot(path=f"{DIR}{course_name}_{screen_num}.png", full_page=True) print("Course outline links:") for idx, link in enumerate(course_links): screen_num += 1 - print(f"{idx + 1}. {link}") + print(f"The Activity URL is: {idx + 1}. {link}") page.goto(f"{link}") - page.screenshot(path=f"{DIR}-{course_name}_{screen_num}.png", full_page=True) + page.screenshot(path=f"{DIR}{course_name}_{screen_num}.png", full_page=True) + print(f"The filename and path is: {DIR}{course_name}_{screen_num}.png") browser.close() - # find_pictures() + find_pictures(DIR) def find_pictures(DIR):