Azzan Dwi Riski commited on
Commit
5755686
·
1 Parent(s): 2af5ea1

fix tokenizer issues

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -169,17 +169,13 @@ def take_screenshot(url):
169
  browser = p.chromium.launch()
170
  page = browser.new_page(viewport={"width": 1280, "height": 800})
171
 
172
- # Add timeout and navigation options
173
- page.set_default_timeout(60000) # 60 seconds timeout
174
-
175
- # Navigate to the URL with wait until options
176
  page.goto(url, wait_until="networkidle", timeout=60000)
177
-
178
- # Wait a bit for dynamic content to load
179
  page.wait_for_timeout(3000)
180
 
181
- # Take full page screenshot
182
- page.screenshot(path=filepath, full_page=True)
183
  browser.close()
184
 
185
  print(f"Screenshot taken for URL: {url}")
 
169
  browser = p.chromium.launch()
170
  page = browser.new_page(viewport={"width": 1280, "height": 800})
171
 
172
+ # Set timeout and navigation
173
+ page.set_default_timeout(60000)
 
 
174
  page.goto(url, wait_until="networkidle", timeout=60000)
 
 
175
  page.wait_for_timeout(3000)
176
 
177
+ # Take viewport-only screenshot (default behavior)
178
+ page.screenshot(path=filepath) # full_page=False by default
179
  browser.close()
180
 
181
  print(f"Screenshot taken for URL: {url}")