基于AI的Python爬虫
Go to file
2024-02-23 10:33:25 +01:00
.github bugfix of the action 2024-02-19 12:24:14 +01:00
.streamlit added trulens 2024-02-23 09:39:25 +01:00
docs add new node 2024-02-17 21:42:43 +01:00
examples fixed eval output 2024-02-23 10:33:25 +01:00
scrapegraphai fixed eval output 2024-02-23 10:33:25 +01:00
tests/utils refactoring of the code, add tests and examples 2024-02-19 11:54:36 +01:00
.gitattributes Initial commit 2024-01-27 17:54:23 +01:00
.gitignore added trulens 2024-02-23 09:39:25 +01:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2024-02-05 10:20:57 +01:00
commit_and_push.sh refactoring of the code, add tests and examples 2024-02-19 11:54:36 +01:00
CONTRIBUTING.md upd: updated readme and fixed setup.py 2024-02-15 01:30:51 +01:00
LICENSE add new node 2024-02-17 21:42:43 +01:00
poetry.lock updated lock 2024-02-23 10:00:58 +01:00
pyproject.toml updated lock 2024-02-23 10:00:58 +01:00
README.md add api_key as parameter instead of .env file 2024-02-22 21:13:01 +01:00
readthedocs.yml changed the read the docs command 2024-02-15 08:58:03 +01:00
requirements-dev.txt add: poetry.toml for actions 2024-02-17 15:31:12 +01:00
requirements.txt dev trulens_evaluetor 2024-02-22 19:19:10 +01:00
SECURITY.md changed documentation + fixed a typo for the path 2024-02-07 16:56:03 +01:00

🕷️ ScrapeGraphAI: You Only Scrape Once

ScrapeGraphAI is a web scraping python library based on LangChain which uses LLM and direct graph logic to create scraping pipelines. Just say which information you want to extract and the library will do it for you!

Scrapegraph-ai Logo

🚀 Quick install

The reference page for Scrapegraph-ai is avaible on the official page of pypy: pypi.

pip install scrapegraphai

🔍 Demo

Official streamlit demo:

My Skills

Is it possible to try also the colab version

Open In Colab

Try out ScrapeGraphAI in your browser:

Open in GitHub Codespaces

📖 Documentation

The documentation for ScrapeGraphAI can be found here. Behind this there is also the docusaurus documentation here).

Setup the api keys

Follow the procedure on the following link to setup your OpenAI API key: link.

💻 Usage

Case 1: Extracting information using a prompt

You can use the SmartScraper class to extract information from a website using a prompt.

The SmartScraper class is a direct graph implementation that uses the most common nodes present in a web scraping pipeline. For more information, please see the documentation.

from scrapegraphai.graphs import SmartScraper

OPENAI_API_KEY = "YOUR_API_KEY"

llm_config = {
    "api_key": OPENAI_API_KEY,
    "model_name": "gpt-3.5-turbo",
}

smart_scraper = SmartScraper("List me all the titles and project descriptions",
                             "https://perinim.github.io/projects/", llm_config)

answer = smart_scraper.run()
print(answer)

The output will be a dictionary with the extracted information, for example:

{
    'titles': [
        'Rotary Pendulum RL'
        ],
    'descriptions': [
        'Open Source project aimed at controlling a real life rotary pendulum using RL algorithms'
        ]
}

🤝 Contributing

Scrapegraph-ai is MIT LICENSED.

Contributions are welcome! Please check out the todos below, and feel free to open a pull request.

For more information, please see the contributing guidelines.

Join our Discord server to discuss with us improvements and give us suggestions!

My Skills

You can also follow all the updates on linkedin!

My Skills

Contributors

Contributors

Authors

Authors Logos

Contact Info
Marco Vinciguerra Linkedin Badge
Marco Perini Linkedin Badge
Lorenzo Padoan Linkedin Badge

📜 License

ScrapeGraphAI is licensed under the Apache 2.0 License. See the LICENSE file for more information.

Acknowledgements

  • We would like to thank all the contributors to the project and the open-source community for their support.
  • ScrapeGraphAI is meant to be used for data exploration and research purposes only. We are not responsible for any misuse of the library.