Skip to content

Python scraper based on AI

refactoring of the code

DPendea8907cf53a92
diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 84b03a0d..00000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/getter.py b/getter.py
index 497e6ce0..e499621f 100644
--- a/getter.py
+++ b/getter.py
@@ -1,11 +1,9 @@
import requests
from bs4 import BeautifulSoup
-
HEADERS = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36',
'Accept-Language': 'en-US'}
-
def get_function(link:str, param = HEADERS) -> str:
"""
It sends a GET request to the specified link with optional headers.
@@ -20,9 +18,6 @@ def get_function(link:str, param = HEADERS) -> str:
response = requests.get(url=link, headers=HEADERS)
return str(response.content)
-
-
-
def scraper(link: str, max_char: int) -> str:
"""
Scrapes the HTML text and removes unwanted elements, text, and comments.
diff --git a/pydantic_class.py b/pydantic_class.py
index e6172250..459f837f 100644
--- a/pydantic_class.py
+++ b/pydantic_class.py
@@ -1,4 +1,3 @@
-
from langchain_core.pydantic_v1 import BaseModel, Field
class Response(BaseModel):