kfahn commited on
Commit
0246665
·
verified ·
1 Parent(s): d40b66d

Update app.py

Browse files

It worked in OpenProcessing. Trying again with p5.js

Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -72,19 +72,17 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
72
  # print("Screenshot saved!")
73
 
74
  async def capture_screenshot():
75
- """Launches Playwright and captures a screenshot of an image from GitHub."""
76
  print("Launching Playwright...")
77
  async with async_playwright() as p:
78
  browser = await p.chromium.launch(headless=True)
79
  page = await browser.new_page()
80
 
81
- # Use the raw GitHub image URL
82
- url = "https://openprocessing.org/sketch/2539973"
83
- #url = "https://thecodingtrain.com/showcase/author/kathy-mcguiness"
84
- #url = "https://huggingface.co/datasets/hf-vision/course-assets/raw/main/feature-extraction-feature-matching/Flow-Chart-for-SURF-Feature-Detection.png"
85
  image_url = url
86
 
87
- print(f"Opening image from GitHub: {image_url}")
88
  await page.goto(image_url, timeout=120000) # Wait for the image page to load
89
 
90
  print("Waiting for image element...")
 
72
  # print("Screenshot saved!")
73
 
74
  async def capture_screenshot():
75
+ """Launches Playwright and captures a screenshot of an image from p5.js."""
76
  print("Launching Playwright...")
77
  async with async_playwright() as p:
78
  browser = await p.chromium.launch(headless=True)
79
  page = await browser.new_page()
80
 
81
+ #url = "https://openprocessing.org/sketch/2539973"
82
+ url = "https://editor.p5js.org/kfahn/full/2XD5Y8MiV"
 
 
83
  image_url = url
84
 
85
+ print(f"Opening image from p5 sketch: {image_url}")
86
  await page.goto(image_url, timeout=120000) # Wait for the image page to load
87
 
88
  print("Waiting for image element...")