# ๐Ÿ•ท๏ธ ScrapeGraphAI: ํ•œ ๋ฐฉ์— ๋๋‚ด๋Š” ์›น์Šคํฌ๋ž˜ํ•‘ ScrapeGraphAI๋Š” ์›น ์‚ฌ์ดํŠธ์™€ ๋กœ์ปฌ ๋ฌธ์„œ(XML, HTML, JSON ๋“ฑ)์— ๋Œ€ํ•œ ์Šคํฌ๋ž˜ํ•‘ ํŒŒ์ดํ”„๋ผ์ธ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด LLM ๋ฐ ์ง์ ‘ ๊ทธ๋ž˜ํ”„ ๋กœ์ง์„ ์‚ฌ์šฉํ•˜๋Š” ํŒŒ์ด์ฌ ์›น์Šคํฌ๋ž˜ํ•‘ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค. ์ถ”์ถœํ•˜๋ ค๋Š” ์ •๋ณด๋ฅผ ๋งํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์•Œ์•„์„œ ์ฒ˜๋ฆฌํ•ด ์ค๋‹ˆ๋‹ค!

ScrapeGraphAI Hero

## ๐Ÿš€ ๋น ๋ฅธ ์„ค์น˜ Scrapegraph-ai์— ๋Œ€ํ•œ ์ฐธ์กฐ ํŽ˜์ด์ง€๋Š” PyPI์˜ ๊ณต์‹ ํŽ˜์ด์ง€์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: [pypi](https://pypi.org/project/scrapegraphai/). ```bash pip install scrapegraphai ``` ์ฐธ๊ณ : ๋‹ค๋ฅธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€์˜ ์ถฉ๋Œ์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๊ฐ€์ƒ ํ™˜๊ฒฝ์— ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค ๐Ÿฑ ## ๐Ÿ” ๋ฐ๋ชจ ๊ณต์‹ Streamlit ๋ฐ๋ชจ: [![My Skills](https://skillicons.dev/icons?i=react)](https://scrapegraph-ai-web-dashboard.streamlit.app) Google Colab์„ ์‚ฌ์šฉํ•˜์—ฌ ์›น์—์„œ ์ง์ ‘ ์‚ฌ์šฉํ•ด ๋ณด์„ธ์š”: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1sEZBonBMGP44CtO6GQTwAlL0BGJXjtfd?usp=sharing) ## ๐Ÿ“– ๋ฌธ์„œ ScrapeGraphAI์— ๋Œ€ํ•œ ๋ฌธ์„œ๋Š” [์—ฌ๊ธฐ](https://scrapegraph-ai.readthedocs.io/en/latest/)์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ Docusaurus๋ฅผ [์—ฌ๊ธฐ](https://scrapegraph-doc.onrender.com/)์—์„œ ํ™•์ธํ•ด ๋ณด์„ธ์š”. ## ๐Ÿ’ป ์‚ฌ์šฉ๋ฒ• ์›น์‚ฌ์ดํŠธ(๋˜๋Š” ๋กœ์ปฌ ํŒŒ์ผ)์—์„œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์—ฌ๋Ÿฌ ํ‘œ์ค€ ์Šคํฌ๋ž˜ํ•‘ ํŒŒ์ดํ”„๋ผ์ธ์ด ์žˆ์Šต๋‹ˆ๋‹ค: - `SmartScraperGraph`: ์‚ฌ์šฉ์ž ํ”„๋กฌํ”„ํŠธ์™€ ์ž…๋ ฅ ์†Œ์Šค๋งŒ ํ•„์š”๋กœ ํ•˜๋Š” ๋‹จ์ผ ํŽ˜์ด์ง€ ์Šคํฌ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. - `SearchGraph`: ๊ฒ€์ƒ‰ ์—”์ง„์˜ ์ƒ์œ„ n๊ฐœ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ์—์„œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๋Š” ๋‹ค์ค‘ ํŽ˜์ด์ง€ ์Šคํฌ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. - `SpeechGraph`: ์›น์‚ฌ์ดํŠธ์—์„œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๊ณ  ์˜ค๋””์˜ค ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๋Š” ๋‹จ์ผ ํŽ˜์ด์ง€ ์Šคํฌ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. - `ScriptCreatorGraph`: ์›น์‚ฌ์ดํŠธ์—์„œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๊ณ  Python ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋‹จ์ผ ํŽ˜์ด์ง€ ์Šคํฌ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. - `SmartScraperMultiGraph`: ๋‹จ์ผ ํ”„๋กฌํ”„ํŠธ์™€ ์†Œ์Šค ๋ชฉ๋ก์„ ์‚ฌ์šฉํ•˜์—ฌ ์—ฌ๋Ÿฌ ํŽ˜์ด์ง€์—์„œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๋Š” ๋‹ค์ค‘ ํŽ˜์ด์ง€ ์Šคํฌ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. - `ScriptCreatorMultiGraph`: ๋‹จ์ผ ํ”„๋กฌํ”„ํŠธ์™€ ์†Œ์Šค ๋ชฉ๋ก์„ ์‚ฌ์šฉํ•˜์—ฌ ์—ฌ๋Ÿฌ ํŽ˜์ด์ง€์—์„œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๋Š” Python ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋‹ค์ค‘ ํŽ˜์ด์ง€ ์Šคํฌ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. **OpenAI**, **Groq**, **Azure**, **Gemini**์™€ ๊ฐ™์€ API๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ LLM์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, **Ollama**๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ์ปฌ ๋ชจ๋ธ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ### ์‚ฌ๋ก€ 1: ๋กœ์ปฌ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜๋Š” SmartScraper [Ollama](https://ollama.com/)๋ฅผ ์„ค์น˜ํ•˜๊ณ  **ollama pull** ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋ธ์„ ๋‹ค์šด๋กœ๋“œํ•˜์„ธ์š”. ```python from scrapegraphai.graphs import SmartScraperGraph graph_config = { "llm": { "model": "ollama/mistral", "temperature": 0, "format": "json", # Ollama needs the format to be specified explicitly "base_url": "http://localhost:11434", # set Ollama URL }, "embeddings": { "model": "ollama/nomic-embed-text", "base_url": "http://localhost:11434", # set Ollama URL }, "verbose": True, } smart_scraper_graph = SmartScraperGraph( prompt="List me all the projects with their descriptions", # also accepts a string with the already downloaded HTML code source="https://perinim.github.io/projects", config=graph_config ) result = smart_scraper_graph.run() print(result) ``` ์ถœ๋ ฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ”„๋กœ์ ํŠธ์™€ ์„ค๋ช…์˜ ๋ชฉ๋ก์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค: ```python {'projects': [{'title': 'Rotary Pendulum RL', 'description': 'Open Source project aimed at controlling a real life rotary pendulum using RL algorithms'}, {'title': 'DQN Implementation from scratch', 'description': 'Developed a Deep Q-Network algorithm to train a simple and double pendulum'}, ...]} ``` ### ์‚ฌ๋ก€ 2: ํ˜ผํ•ฉ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜๋Š” SearchGraph ์šฐ๋ฆฌ๋Š” LLM์— **Groq**๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , ์ž„๋ฒ ๋”ฉ์— **Ollama**๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ```python from scrapegraphai.graphs import SearchGraph # Define the configuration for the graph graph_config = { "llm": { "model": "groq/gemma-7b-it", "api_key": "GROQ_API_KEY", "temperature": 0 }, "embeddings": { "model": "ollama/nomic-embed-text", "base_url": "http://localhost:11434", # set ollama URL arbitrarily }, "max_results": 5, } # Create the SearchGraph instance search_graph = SearchGraph( prompt="List me all the traditional recipes from Chioggia", config=graph_config ) # Run the graph result = search_graph.run() print(result) ``` ์ถœ๋ ฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ ˆ์‹œํ”ผ ๋ชฉ๋ก์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค: ```python {'recipes': [{'name': 'Sarde in Saรฒre'}, {'name': 'Bigoli in salsa'}, {'name': 'Seppie in umido'}, {'name': 'Moleche frite'}, {'name': 'Risotto alla pescatora'}, {'name': 'Broeto'}, {'name': 'Bibarasse in Cassopipa'}, {'name': 'Risi e bisi'}, {'name': 'Smegiassa Ciosota'}]} ``` ### ์‚ฌ๋ก€ 3: OpenAI๋ฅผ ์‚ฌ์šฉํ•˜๋Š” SpeechGraph OpenAI API ํ‚ค์™€ ๋ชจ๋ธ ์ด๋ฆ„๋งŒ ์ „๋‹ฌํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ```python from scrapegraphai.graphs import SpeechGraph graph_config = { "llm": { "api_key": "OPENAI_API_KEY", "model": "openai/gpt-3.5-turbo", }, "tts_model": { "api_key": "OPENAI_API_KEY", "model": "tts-1", "voice": "alloy" }, "output_path": "audio_summary.mp3", } # ************************************************ # Create the SpeechGraph instance and run it # ************************************************ speech_graph = SpeechGraph( prompt="Make a detailed audio summary of the projects.", source="https://perinim.github.io/projects/", config=graph_config, ) result = speech_graph.run() print(result) ``` ์ถœ๋ ฅ์€ ํŽ˜์ด์ง€์˜ ํ”„๋กœ์ ํŠธ ์š”์•ฝ์ด ํฌํ•จ๋œ ์˜ค๋””์˜ค ํŒŒ์ผ์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ## ์Šคํฐ
SerpAPI Stats
## ๐Ÿค ๊ธฐ์—ฌ ๊ธฐ์—ฌ๋ฅผ ํ™˜์˜ํ•˜๋ฉฐ, ๊ฐœ์„  ์‚ฌํ•ญ์„ ๋…ผ์˜ํ•˜๊ณ  ์ œ์•ˆ ์‚ฌํ•ญ์„ ์ฃผ๊ณ ๋ฐ›๊ธฐ ์œ„ํ•ด ์šฐ๋ฆฌ์˜ Discord ์„œ๋ฒ„์— ์ฐธ์—ฌํ•˜์„ธ์š”! ๊ธฐ์—ฌ ๊ฐ€์ด๋“œ๋ผ์ธ์„ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”: [contributing guidelines](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/CONTRIBUTING.md). ## ๐Ÿ“ˆ ๋กœ๋“œ๋งต ๋‹ค์Œ ๊ธฐ๋Šฅ๋“ค์„ ์ž‘์—…ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค! ํ˜‘์—…์— ๊ด€์‹ฌ์ด ์žˆ์œผ์‹œ๋ฉด ํ•ด๋‹น ๊ธฐ๋Šฅ์„ ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ์œผ๋กœ ํด๋ฆญํ•˜์—ฌ ์ƒˆ ํƒญ์—์„œ PR์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ์˜๋ฌธ์‚ฌํ•ญ์ด ์žˆ๊ฑฐ๋‚˜ ๋…ผ์˜ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด [Discord](https://discord.gg/uJN7TYcpNa)์—์„œ ์ €ํฌ์—๊ฒŒ ์—ฐ๋ฝํ•˜๊ฑฐ๋‚˜ Github์˜ [Discussion](https://github.com/VinciGit00/Scrapegraph-ai/discussions) ํŽ˜์ด์ง€๋ฅผ ์—ด์–ด์ฃผ์„ธ์š”! ```mermaid %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#5C4B9B', 'edgeLabelBackground':'#ffffff', 'tertiaryColor': '#ffffff', 'primaryBorderColor': '#5C4B9B', 'fontFamily': 'Arial', 'fontSize': '16px', 'textColor': '#5C4B9B' }}}%% graph LR A[DeepSearch Graph] --> F[Use Existing Chromium Instances] F --> B[Page Caching] B --> C[Screenshot Scraping] C --> D[Handle Dynamic Content] D --> E[New Webdrivers] style A fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10 style F fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10 style B fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10 style C fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10 style D fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10 style E fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10 click A href "https://github.com/VinciGit00/Scrapegraph-ai/issues/260" "Open DeepSearch Graph Issue" click F href "https://github.com/VinciGit00/Scrapegraph-ai/issues/329" "Open Chromium Instances Issue" click B href "https://github.com/VinciGit00/Scrapegraph-ai/issues/197" "Open Page Caching Issue" click C href "https://github.com/VinciGit00/Scrapegraph-ai/issues/197" "Open Screenshot Scraping Issue" click D href "https://github.com/VinciGit00/Scrapegraph-ai/issues/279" "Open Handle Dynamic Content Issue" click E href "https://github.com/VinciGit00/Scrapegraph-ai/issues/171" "Open New Webdrivers Issue" ``` ## ๏ธ ๊ธฐ์—ฌ์ž๋“ค [![Contributors](https://contrib.rocks/image?repo=VinciGit00/Scrapegraph-ai)](https://github.com/VinciGit00/Scrapegraph-ai/graphs/contributors) ## ๐ŸŽ“ ์ธ์šฉ ์šฐ๋ฆฌ์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์—ฐ๊ตฌ ๋ชฉ์ ์œผ๋กœ ์‚ฌ์šฉํ•œ ๊ฒฝ์šฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ธ์šฉํ•ด ์ฃผ์„ธ์š”: ```text @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 leveraging large language models} } ``` ## ์ €์ž๋“ค

Authors_logos

| | ์—ฐ๋ฝ์ฒ˜ | |--------------------|---------------| | Marco Vinciguerra | [![Linkedin Badge](https://img.shields.io/badge/-Linkedin-blue?style=flat&logo=Linkedin&logoColor=white)](https://www.linkedin.com/in/marco-vinciguerra-7ba365242/) | | Marco Perini | [![Linkedin Badge](https://img.shields.io/badge/-Linkedin-blue?style=flat&logo=Linkedin&logoColor=white)](https://www.linkedin.com/in/perinim/) | | Lorenzo Padoan | [![Linkedin Badge](https://img.shields.io/badge/-Linkedin-blue?style=flat&logo=Linkedin&logoColor=white)](https://www.linkedin.com/in/lorenzo-padoan-4521a2154/) | ## ๐Ÿ“œ ๋ผ์ด์„ ์Šค ScrapeGraphAI๋Š” MIT License๋กœ ๋ฐฐํฌ๋˜์—ˆ์Šต๋‹ˆ. ์ž์„ธํ•œ ๋‚ด์šฉ์€ [LICENSE](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/LICENSE) ํŒŒ์ผ์„ ์ฐธ์กฐํ•˜์„ธ์š”. ## ๊ฐ์‚ฌ์˜ ๋ง - ํ”„๋กœ์ ํŠธ์— ๊ธฐ์—ฌํ•œ ๋ชจ๋“  ๋ถ„๋“ค๊ณผ ์˜คํ”ˆ ์†Œ์Šค ์ปค๋ฎค๋‹ˆํ‹ฐ์— ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค. - ScrapeGraphAI๋Š” ๋ฐ์ดํ„ฐ ํƒ์ƒ‰ ๋ฐ ์—ฐ๊ตฌ ๋ชฉ์ ์œผ๋กœ๋งŒ ์‚ฌ์šฉ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ์˜ค์šฉ์— ๋Œ€ํ•ด ์ฑ…์ž„์„ ์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค.