Skip to content

Commit 5c16ee9

Browse files
committed
fix(docloaders): BrowserBase dynamic import
1 parent 22ab45f commit 5c16ee9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scrapegraphai/docloaders/browser_base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
browserbase integration module
33
"""
44
from typing import List
5-
from browserbase import Browserbase
65

76
def browser_base_fetch(api_key: str, project_id: str, link: List[str]) -> List[str]:
87
"""
@@ -41,6 +40,12 @@ def browser_base_fetch(api_key: str, project_id: str, link: List[str]) -> List[s
4140
object: The result of the loading operation.
4241
"""
4342

43+
try:
44+
from browserbase import Browserbase
45+
except ImportError:
46+
raise ImportError("The browserbase module is not installed. Please install it using `pip install browserbase`.")
47+
48+
4449
browserbase = Browserbase(api_key=api_key, project_id=project_id)
4550

4651
result = []

0 commit comments

Comments
 (0)