mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
17 lines
527 B
Python
17 lines
527 B
Python
|
from typing import List
|
||
|
|
||
|
from langchain_core.documents import Document
|
||
|
|
||
|
from langchain_community.document_loaders.web_base import WebBaseLoader
|
||
|
|
||
|
|
||
|
class CollegeConfidentialLoader(WebBaseLoader):
|
||
|
"""Load `College Confidential` webpages."""
|
||
|
|
||
|
def load(self) -> List[Document]:
|
||
|
"""Load webpages as Documents."""
|
||
|
soup = self.scrape()
|
||
|
text = soup.select_one("main[class='skin-handler']").text
|
||
|
metadata = {"source": self.web_path}
|
||
|
return [Document(page_content=text, metadata=metadata)]
|