Skip to content

Commit 02eed1a

Browse files
authored
Merge branch 'main' into main
2 parents d56253d + cd4ffd7 commit 02eed1a

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [1.17.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.16.0...v1.17.0) (2024-09-08)
2+
3+
4+
### Features
5+
6+
* **docloaders:** Enhance browser_base_fetch function flexibility ([57fd01f](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/57fd01f9a76ea8ea69ec04b7238ab58ca72ac8f4))
7+
8+
9+
### Docs
10+
11+
* **sponsor:** 🅱️ Browserbase sponsor 🅱️ ([a540139](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/a5401394cc939d9a5fc58b8a9145141c2f047bab))
12+
113
## [1.16.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.15.2...v1.16.0) (2024-09-01)
214

315

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "scrapegraphai"
3-
version = "1.16.0"
3+
version = "1.17.0"
44
description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
55
authors = [
66
{ name = "Marco Vinciguerra", email = "mvincig11@gmail.com" },

scrapegraphai/docloaders/browser_base.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
from typing import List
55

6-
def browser_base_fetch(api_key: str, project_id: str, link: List[str]) -> List[str]:
6+
def browser_base_fetch(api_key: str, project_id: str, link: List[str], text_content: bool = True) -> List[str]:
77
"""
88
BrowserBase Fetch
99
@@ -53,22 +53,19 @@ def browser_base_fetch(api_key: str, project_id: str, link: List[str]) -> List[s
5353
browserbase = Browserbase(api_key=api_key, project_id=project_id)
5454

5555
result = []
56-
# Define the async fetch logic for individual links
5756
async def _async_fetch_link(l):
5857
return await asyncio.to_thread(browserbase.load, l, text_content=text_content)
5958

6059
if async_mode:
61-
# Asynchronously process each link
6260
async def _async_browser_base_fetch():
6361
for l in link:
6462
result.append(await _async_fetch_link(l))
6563
return result
6664

67-
# Run the async fetch function
6865
result = asyncio.run(_async_browser_base_fetch())
6966
else:
70-
# Synchronous logic
7167
for l in link:
7268
result.append(browserbase.load(l, text_content=text_content))
7369

70+
7471
return result

0 commit comments

Comments
 (0)