This release is a pre-release and may not be stable for production use.
1
🕷️ 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 for websites and documents. Just say which information you want to extract and the library will do it for you!
🚀 Quick install
The reference page for Scrapegraph-ai is avaible on the official page of pypy: pypi.
pip install scrapegraphai
🔍 Demo
Official streamlit demo:
Try it directly on the web using Google Colab:
Follow the procedure on the following link to setup your OpenAI API key: link.
📖 Documentation
The documentation for ScrapeGraphAI can be found here.
Check out also the docusaurus documentation.
💻 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.
import os
from dotenv import load_dotenv
from scrapegraphai.graphs import SmartScraperGraph
load_dotenv()
openai_key = os.getenv("OPENAI_APIKEY")
# Define the configuration for the graph
graph_config = {
"llm": {
"api_key": openai_key,
"model": "gpt-3.5-turbo",
},
}
# Create the SmartScraperGraph instance
smart_scraper_graph = SmartScraperGraph(
prompt="List me all the titles and project descriptions"
file_source="https://perinim.github.io/projects/", # also accepts a local file path
config=graph_config
)
result = smart_scraper_graph.run()
print(result)
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
Fell free to contribute and join our Discord server to discuss with us improvements and give us suggestions!
For more information, please see the contributing guidelines.
❤️ Contributors
🎓 Citations
If you have used our library for research purposes please quote us with the following reference:
@misc{scrapegraph-ai,
author = {Marco Perini, Lorenzo Padoan, Marco Vinciguerra},
title = {Scrapegraph-ai},
year = {2024},
url = {https://github.com/VinciGit00/Scrapegraph-ai},
note = {A Python library for scraping data from graphs}
}
Authors
| Contact Info | |
|---|---|
| Marco Vinciguerra | |
| Marco Perini | |
| Lorenzo Padoan |
📜 License
ScrapeGraphAI is licensed under the MIT 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.
Metadata
Release files for scrapegraphaisub 0.0.12b4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scrapegraphaisub-0.0.12b4.tar.gz | 25.0 kB | Without provenance | Details for scrapegraphaisub-0.0.12b4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scrapegraphaisub-0.0.12b4-py3-none-any.whl | Python 3 | none | any | Details for scrapegraphaisub-0.0.12b4-py3-none-any.whl |
Total release size: 63.4 kB
Release files / scrapegraphaisub-0.0.12b4.tar.gz
| Download URL | scrapegraphaisub-0.0.12b4.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7af1cd1d58398ef6afcc582760a22f1d5240b0623cdfabc570555cc7bde4a95
|
|
BLAKE2b-256 checksum How to use checksums |
db2d4225f692877fc8fe3b633b376ac8e9ea32c6f7a4f5947bd5421185d3e6e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / scrapegraphaisub-0.0.12b4-py3-none-any.whl
| Download URL | scrapegraphaisub-0.0.12b4-py3-none-any.whl |
|---|---|
| Size | 38.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc1949a33dc90f5aa7def7c3c32420c053d50f564cfc08d04a08ef2a6272f58a
|
|
BLAKE2b-256 checksum How to use checksums |
393fa95591745dc2650d1f0c8b1f1efd70e5ddaceae11edbe7ff76e1b0532ad3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for scrapegraphaisub 0.0.12b4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.