mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Added fake user-agent headers to browser request.
This commit is contained in:
@@ -6,7 +6,7 @@ from llm_utils import create_chat_completion
|
||||
cfg = Config()
|
||||
|
||||
def scrape_text(url):
|
||||
response = requests.get(url)
|
||||
response = requests.get(url, headers=cfg.user_agent_header)
|
||||
|
||||
# Check if the response contains an HTTP error
|
||||
if response.status_code >= 400:
|
||||
@@ -40,7 +40,7 @@ def format_hyperlinks(hyperlinks):
|
||||
|
||||
|
||||
def scrape_links(url):
|
||||
response = requests.get(url)
|
||||
response = requests.get(url, headers=cfg.user_agent_header)
|
||||
|
||||
# Check if the response contains an HTTP error
|
||||
if response.status_code >= 400:
|
||||
|
||||
Reference in New Issue
Block a user