Merge branch 'master' into dev

This commit is contained in:
Andres Caicedo
2023-04-09 15:42:53 +02:00
28 changed files with 918 additions and 95 deletions

View File

@@ -7,7 +7,7 @@ cfg = Config()
def scrape_text(url):
"""Scrape text from a webpage"""
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:
@@ -43,8 +43,8 @@ def format_hyperlinks(hyperlinks):
def scrape_links(url):
"""Scrape hyperlinks from a webpage"""
response = requests.get(url)
"""Scrape links from a webpage"""
response = requests.get(url, headers=cfg.user_agent_header)
# Check if the response contains an HTTP error
if response.status_code >= 400: