mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
wait up to 5sec
This commit is contained in:
parent
4ebc35e038
commit
dece830cb8
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,7 @@ import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
import playwright
|
||||||
import pypandoc
|
import pypandoc
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
|
@ -81,7 +82,10 @@ class Scraper:
|
||||||
user_agent += " " + aider_user_agent
|
user_agent += " " + aider_user_agent
|
||||||
|
|
||||||
page = browser.new_page(user_agent=user_agent)
|
page = browser.new_page(user_agent=user_agent)
|
||||||
page.goto(url, wait_until="networkidle", timeout=5000)
|
try:
|
||||||
|
page.goto(url, wait_until="networkidle", timeout=5000)
|
||||||
|
except playwright._impl._errors.TimeoutError:
|
||||||
|
pass
|
||||||
content = page.content()
|
content = page.content()
|
||||||
browser.close()
|
browser.close()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue