browse: make scrape_links() & scrape_text() "status_code >= 400" error message the same

This commit is contained in:
Itamar Friedman
2023-04-11 11:40:52 +03:00
parent 2d5d0131bb
commit 64c21ee8f7
2 changed files with 2 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ def scrape_links(url):
# Check if the response contains an HTTP error
if response.status_code >= 400:
return "error"
return "Error: HTTP " + str(response.status_code) + " error"
soup = BeautifulSoup(response.text, "html.parser")