forked from Archives/langchain
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
562 B
Python
17 lines
562 B
Python
"""Loader that loads College Confidential."""
|
|
from typing import List
|
|
|
|
from langchain.docstore.document import Document
|
|
from langchain.document_loaders.web_base import WebBaseLoader
|
|
|
|
|
|
class CollegeConfidentialLoader(WebBaseLoader):
|
|
"""Loader that loads College Confidential webpages."""
|
|
|
|
def load(self) -> List[Document]:
|
|
"""Load webpage."""
|
|
soup = self.scrape()
|
|
text = soup.select_one("main[class='skin-handler']").text
|
|
metadata = {"source": self.web_path}
|
|
return [Document(page_content=text, metadata=metadata)]
|