Update browse.py

Just import GET from requests library.
This commit is contained in:
Andres Caicedo
2023-04-04 10:54:52 +02:00
parent 39f758ba5c
commit 772d4beb21

View File

@@ -1,4 +1,4 @@
import requests from requests import get
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from config import Config from config import Config
from llm_utils import create_chat_completion from llm_utils import create_chat_completion
@@ -8,7 +8,7 @@ cfg = Config()
def scrape_text(url): def scrape_text(url):
"""Scrape text from a webpage""" """Scrape text from a webpage"""
response = requests.get(url) response = get(url)
# Check if the response contains an HTTP error # Check if the response contains an HTTP error
if response.status_code >= 400: if response.status_code >= 400:
@@ -49,7 +49,7 @@ def format_hyperlinks(hyperlinks):
def scrape_links(url): def scrape_links(url):
"""Scrape hyperlinks from a webpage""" """Scrape hyperlinks from a webpage"""
response = requests.get(url) response = get(url)
# Check if the response contains an HTTP error # Check if the response contains an HTTP error
if response.status_code >= 400: if response.status_code >= 400: