mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-12 21:01:54 +08:00
31 lines
565 B
Python
31 lines
565 B
Python
"""
|
|
Example of custom graph using existing nodes
|
|
"""
|
|
|
|
from scrapegraphai.nodes import FetchNode
|
|
|
|
# ************************************************
|
|
# Define the node
|
|
# ************************************************
|
|
|
|
|
|
fetch_node = FetchNode(
|
|
input="url | local_dir",
|
|
output=["doc"],
|
|
node_config={
|
|
"headless": False
|
|
}
|
|
)
|
|
|
|
# ************************************************
|
|
# Test the node
|
|
# ************************************************
|
|
|
|
state = {
|
|
"url": "https://twitter.com/home"
|
|
}
|
|
|
|
result = fetch_node.execute(state)
|
|
|
|
print(result)
|