[New] Beehiiv loader (#963)
This commit is contained in:
@@ -12,9 +12,7 @@ from embedchain.utils import is_readable
|
||||
@register_deserializable
|
||||
class SubstackLoader(BaseLoader):
|
||||
"""
|
||||
This method takes a sitemap URL as input and retrieves
|
||||
all the URLs to use the WebPageLoader to load content
|
||||
of each page.
|
||||
This loader is used to load data from Substack URLs.
|
||||
"""
|
||||
|
||||
def load_data(self, url: str):
|
||||
@@ -62,10 +60,10 @@ class SubstackLoader(BaseLoader):
|
||||
|
||||
def load_link(link: str):
|
||||
try:
|
||||
each_load_data = requests.get(link)
|
||||
each_load_data.raise_for_status()
|
||||
substack_data = requests.get(link)
|
||||
substack_data.raise_for_status()
|
||||
|
||||
soup = BeautifulSoup(response.text, "html.parser")
|
||||
soup = BeautifulSoup(substack_data.text, "html.parser")
|
||||
data = serialize_response(soup)
|
||||
data = str(data)
|
||||
if is_readable(data):
|
||||
|
||||
Reference in New Issue
Block a user