VinciGit00 / Scrapegraph-ai

Python scraper based on AI

Home Page:https://scrapegraphai.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem running the example notebook in the readme

tindo2003 opened this issue · comments

Describe the bug
Ran into KeyError when running the ScrapeGraphAI - Examples Colab Notebook .

Screenshot 2024-06-04 at 9 12 11 PM

This is the result of running the following cell:
Screenshot 2024-06-04 at 9 15 03 PM

This is my first time reporting an error, so if you find anything lacking, please let me know. Thank you!

I suspect this is because scrapegraphai/nodes/generate_answer_node.py is a little buggy. On line 94, it should be
something like node_config.get("schema", None) instead of self.node_config["schema"] is None .

please try now again

Hello,
Thank you for your prompt response! The current error is fixed, but I just got another one. I can close this one, and make a pull request since I think I know what the issue is.

Never mind, I could not fix it in the source code. In the following cell,
Screenshot 2024-06-05 at 10 49 01 AM

Can you please change it to something like

result, execution_info = graph.execute(
    {
        "user_prompt": "Describe the content",
        "url": "https://perinim.github.io/projects/",
    }
)

as it was done in examples/openai/custom_graph_openai.py. Right now, the error is:

Screenshot 2024-06-05 at 10 50 12 AM

Thanks a lot!

Hey @tindo2003 modified the colab, thanks!