mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
feat: Add support for following redirects in httpx-based scraping
This commit is contained in:
parent
a77c8ccfa9
commit
3dfc63ce79
1 changed files with 1 additions and 1 deletions
|
@ -185,7 +185,7 @@ class Scraper:
|
||||||
|
|
||||||
headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"}
|
headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"}
|
||||||
try:
|
try:
|
||||||
with httpx.Client(headers=headers, verify=self.verify_ssl) as client:
|
with httpx.Client(headers=headers, verify=self.verify_ssl, follow_redirects=True) as client:
|
||||||
response = client.get(url)
|
response = client.get(url)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return response.text, response.headers.get("content-type", "").split(";")[0]
|
return response.text, response.headers.get("content-type", "").split(";")[0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue