aider: Set a maximum timeout of 5 seconds for page.goto in the scrape_with_playwright method.

# Aider chat conversation:

USER: set a max timeout of 5sec for page.goto

ASSISTANT: To set a maximum timeout of 5 seconds for `page.goto`, we need to modify the `scrape_with_playwright` method in `aider/scrape.py`.

Here is the *SEARCH/REPLACE* block:

aider/scrape.py
```python
<<<<<<< SEARCH
            page.goto(url, wait_until="networkidle")
=======
            page.goto(url, wait_until="networkidle", timeout=5000)
>>>>>>> REPLACE
```
This commit is contained in:
Paul Gauthier 2024-06-11 06:36:35 -07:00
parent 337891e739
commit 4ebc35e038

View file

@ -81,7 +81,7 @@ class Scraper:
user_agent += " " + aider_user_agent
page = browser.new_page(user_agent=user_agent)
page.goto(url, wait_until="networkidle")
page.goto(url, wait_until="networkidle", timeout=5000)
content = page.content()
browser.close()