-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Browserbase integration #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fb87d01
Create browser_base.py
VinciGit00 7076ab1
allignment
VinciGit00 5ecdbe7
feat: add integration in the abstract grapgh
VinciGit00 4cd5986
Merge branch 'pre/beta' into browserbase_integration
VinciGit00 65f9e3a
Delete browser_base.py
VinciGit00 d03eedc
Update chromium.py
VinciGit00 e21d461
push
VinciGit00 968c69e
fix: fixed bug on fetch_node
VinciGit00 6d8e02c
Update browser_base.py
VinciGit00 be870a4
Update fetch_node.py
VinciGit00 fe099f9
Merge branch 'pre/beta' into browserbase_integration
VinciGit00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
""" | ||
Basic example of scraping pipeline using SmartScraper | ||
""" | ||
|
||
import os | ||
import json | ||
from dotenv import load_dotenv | ||
from scrapegraphai.graphs import SmartScraperGraph | ||
from scrapegraphai.utils import prettify_exec_info | ||
|
||
load_dotenv() | ||
|
||
# ************************************************ | ||
# Define the configuration for the graph | ||
# ************************************************ | ||
|
||
|
||
graph_config = { | ||
"llm": { | ||
"api_key": os.getenv("OPENAI_API_KEY"), | ||
"model": "gpt-3.5-turbo", | ||
}, | ||
"browser_base": { | ||
"api_key": os.getenv("BROWSER_BASE_API_KEY"), | ||
"project_id": os.getenv("BROWSER_BASE_API_KEY"), | ||
}, | ||
"verbose": True, | ||
"headless": False, | ||
} | ||
|
||
# ************************************************ | ||
# Create the SmartScraperGraph instance and run it | ||
# ************************************************ | ||
|
||
smart_scraper_graph = SmartScraperGraph( | ||
prompt="List me what does the company do, the name and a contact email.", | ||
source="https://scrapegraphai.com/", | ||
config=graph_config | ||
) | ||
|
||
result = smart_scraper_graph.run() | ||
print(json.dumps(result, indent=4)) | ||
|
||
# ************************************************ | ||
# Get graph execution info | ||
# ************************************************ | ||
|
||
graph_exec_info = smart_scraper_graph.get_execution_info() | ||
print(prettify_exec_info(graph_exec_info)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""__init__.py file for docloaders folder""" | ||
|
||
from .chromium import ChromiumLoader | ||
from .broswer_base import browser_base_fetch | ||
from .browser_base import browser_base_fetch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
""" | ||
Chromium module | ||
""" | ||
import asyncio | ||
from typing import Any, AsyncIterator, Iterator, List, Optional | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.