Arafath10 commited on
Commit
c5d8e33
1 Parent(s): 628e50e

Update scraper.py

Browse files
Files changed (1) hide show
  1. scraper.py +1 -1
scraper.py CHANGED
@@ -28,7 +28,7 @@ class Scraper:
28
  page = await context.new_page()
29
 
30
  # Route to block images, videos, and CSS to speed up page load
31
- await page.route("**/*", lambda route: route.abort() if route.request.resource_type in ["image", "media", "stylesheet"] else route.continue_())
32
 
33
  # Navigate to the page with an extended timeout and alternate loading strategy
34
  await page.goto(url, wait_until='domcontentloaded', timeout=60000)
 
28
  page = await context.new_page()
29
 
30
  # Route to block images, videos, and CSS to speed up page load
31
+ await page.route("**/*", lambda route: route.abort() if route.request.resource_type in ["image", "media", "stylesheet", "font", "xhr"] else route.continue_())
32
 
33
  # Navigate to the page with an extended timeout and alternate loading strategy
34
  await page.goto(url, wait_until='domcontentloaded', timeout=60000)