0
0
LangChainframework~10 mins

Loading web pages with WebBaseLoader in LangChain - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the WebBaseLoader class from langchain.document_loaders.

LangChain
from langchain.document_loaders import [1]
Drag options to blanks, or click blank then click option'
AWebBaseLoader
BWebLoader
CBaseLoader
DWebPageLoader
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'WebLoader' or 'WebPageLoader' which do not exist.
Importing from the wrong module.
2fill in blank
medium

Complete the code to create a WebBaseLoader instance for the URL 'https://example.com'.

LangChain
loader = WebBaseLoader([1])
Drag options to blanks, or click blank then click option'
A'example.com'
B'http://example.com'
C'https://example.com'
Dhttps://example.com
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the URL.
Using 'http://' instead of 'https://'.
3fill in blank
hard

Fix the error in the code to load documents from the loader.

LangChain
docs = loader.[1]()
Drag options to blanks, or click blank then click option'
Aget_docs
Bload
Cfetch
Dload_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'load_data' or 'fetch' which are not valid methods.
Trying to access a property instead of calling a method.
4fill in blank
hard

Fill both blanks to create a WebBaseLoader for 'https://openai.com' and load documents.

LangChain
loader = [1]([2])
docs = loader.load()
Drag options to blanks, or click blank then click option'
AWebBaseLoader
B'https://openai.com'
C'openai.com'
DWebLoader
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'WebLoader' which does not exist.
Passing URL without 'https://'.
5fill in blank
hard

Fill all three blanks to import WebBaseLoader, create a loader for 'https://docs.python.org', and load documents.

LangChain
from langchain.document_loaders import [1]
loader = [2]([3])
docs = loader.load()
Drag options to blanks, or click blank then click option'
AWebBaseLoader
B'https://docs.python.org'
D'docs.python.org'
Attempts:
3 left
💡 Hint
Common Mistakes
Using URL without 'https://'.
Importing or instantiating wrong class names.