Files
wehub-resource-sync fbfefa28d3
CodeQL / Analyze (python) (push) Failing after 0s
Release / Build (push) Failing after 1s
Release / Release (push) Waiting to run
Test Suite / Unit Tests (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:18:10 +08:00

44 lines
881 B
Python

import json
import os
import pytest
from dotenv import load_dotenv
from scrapegraphai.graphs import ScreenshotScraperGraph
# Load environment variables
load_dotenv()
# Define a fixture for the graph configuration
@pytest.fixture
def graph_config():
"""
Creation of the graph
"""
return {
"llm": {
"api_key": os.getenv("OPENAI_API_KEY"),
"model": "gpt-4o",
},
"verbose": True,
"headless": False,
}
def test_screenshot_scraper_graph(graph_config):
"""
test
"""
smart_scraper_graph = ScreenshotScraperGraph(
prompt="List me all the projects",
source="https://perinim.github.io/projects/",
config=graph_config,
)
result = smart_scraper_graph.run()
assert result is not None, "The result should not be None"
print(json.dumps(result, indent=4))