Skip to content

Python scraper based on AI

Merge branch '88-blockscraper-implementation' into asdt

Marco Vinciguerrab32688625004
diff --cc pyproject.toml
index 0321cd7f,a94e07ee..9b358ae5
--- a/pyproject.toml
+++ b/pyproject.toml
@@@ -31,9 -33,16 +33,15 @@@ beautifulsoup4 = "4.12.3
pandas = "2.0.3"
python-dotenv = "1.0.1"
tiktoken = {version = ">=0.5.2,<0.6.0"}
-tqdm = "4.66.3"
-graphviz = "0.20.1"
+tqdm = "4.66.1"
google = "3.0.0"
minify-html = "0.15.0"
+ free-proxy = "1.1.1"
+ langchain-groq = "0.1.3"
+ playwright = "^1.43.0"
+ langchain-aws = "^0.1.2"
+ langchain-anthropic = "^0.1.11"
+ yahoo-search-py="^0.3"
[tool.poetry.dev-dependencies]
pytest = "8.0.0"
diff --cc scrapegraphai/nodes/fetch_node.py
index d912169d,f873654d..4cd4f64e
--- a/scrapegraphai/nodes/fetch_node.py
+++ b/scrapegraphai/nodes/fetch_node.py
@@@ -76,11 -71,23 +71,23 @@@ class FetchNode(BaseNode)
"source": "local_dir"
})]
- # if it is a URL
else:
- loader = AsyncHtmlLoader(source)
+ if self.node_config is not None and self.node_config.get("endpoint") is not None:
+
+ loader = AsyncChromiumLoader(
+ [source],
+ proxies={"http": self.node_config["endpoint"]},
+ headless=self.headless,
+ )
+ else:
+ loader = AsyncChromiumLoader(
+ [source],
+ headless=self.headless,
+ )
+
document = loader.load()
- compressedDocument = [Document(page_content=remover(str(document)))]
+ compressed_document = [
+ Document(page_content=remover(str(document[0].page_content)))]
- state.update({self.output[0]: compressedDocument})
- return state
+ state.update({self.output[0]: compressed_document})
- return state
++ return state