Scrapegraph-ai/examples/single_node/fetch_node.py
2024-04-27 21:23:35 +02:00

28 lines
517 B
Python

"""
Example of custom graph using existing nodes
"""
from scrapegraphai.nodes import FetchNode
# ************************************************
# Define the node
# ************************************************
robots_node = FetchNode(
input="url | local_dir",
output=["doc"],
)
# ************************************************
# Test the node
# ************************************************
state = {
"url": "https://twitter.com/home"
}
result = robots_node.execute(state)
print(result)