๐ท๏ธ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Python aiai-scrapingautomationcrawlercrawlingcrawling-pythondatadata-extractionmcpmcp-serverplaywrightpythonscrapingselectorsstealthweb-scraperweb-scrapingweb-scraping-pythonwebscrapingxpath
docs: Add Korean docs for the website
Karim shoair2995be75a00a
diff --git a/docs/README_KR.md b/docs/README_KR.mdindex 212b5e4..03a9e3f 100644--- a/docs/README_KR.md+++ b/docs/README_KR.md@@ -1,68 +1,68 @@<!-- mcp-name: io.github.D4Vinci/Scrapling --><h1 align="center">- <a href="https://scrapling.readthedocs.io">+ <a href="https://scrapling.readthedocs.io/en/latest/ko/"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/D4Vinci/Scrapling/main/docs/assets/cover_dark.svg?sanitize=true">- <img alt="Scrapling Poster" src="https://raw.githubusercontent.com/D4Vinci/Scrapling/main/docs/assets/cover_light.svg?sanitize=true">+ <img alt="Scrapling ํ์ง" src="https://raw.githubusercontent.com/D4Vinci/Scrapling/main/docs/assets/cover_light.svg?sanitize=true"></picture></a><br>- <small>Effortless Web Scraping for the Modern Web</small>+ <small>ํ๋์ ์ธ ์น์ ๊ฐํธํ๊ฒ ์คํฌ๋ํํ์ธ์</small></h1><p align="center">- <a href="https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml" alt="Tests">- <img alt="Tests" src="https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml/badge.svg"></a>- <a href="https://badge.fury.io/py/Scrapling" alt="PyPI version">- <img alt="PyPI version" src="https://badge.fury.io/py/Scrapling.svg"></a>+ <a href="https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml" alt="ํ ์คํธ">+ <img alt="ํ ์คํธ" src="https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml/badge.svg"></a>+ <a href="https://badge.fury.io/py/Scrapling" alt="PyPI ๋ฒ์ ">+ <img alt="PyPI ๋ฒ์ " src="https://badge.fury.io/py/Scrapling.svg"></a><a href="https://hub.docker.com/r/pyd4vinci/scrapling" target="_blank">- <img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/pyd4vinci/scrapling?labelColor=%20%23FDB062&logo=Docker&labelColor=%20%23528bff"></a>- <a href="https://clickpy.clickhouse.com/dashboard/scrapling" rel="nofollow"><img src="https://img.shields.io/pypi/dm/scrapling" alt="PyPI package downloads"></a>- <a href="https://scrapling.readthedocs.io/en/latest/ai/agent-skill.html" alt="AI Agent Skill">- <img alt="Static Badge" src="https://img.shields.io/badge/Skill-black?style=flat&label=Agent&link=https%3A%2F%2Fscrapling.readthedocs.io%2Fen%2Flatest%2Fai%2Fagent-skill.html"></a>- <a href="https://clawhub.ai/D4Vinci/scrapling-official" alt="OpenClaw Skill">- <img alt="OpenClaw Skill" src="https://img.shields.io/badge/Clawhub-darkred?style=flat&label=OpenClaw&link=https%3A%2F%2Fclawhub.ai%2FD4Vinci%2Fscrapling-official"></a>+ <img alt="Docker ๋ค์ด๋ก๋ ์" src="https://img.shields.io/docker/pulls/pyd4vinci/scrapling?labelColor=%20%23FDB062&logo=Docker&labelColor=%20%23528bff"></a>+ <a href="https://clickpy.clickhouse.com/dashboard/scrapling" rel="nofollow"><img src="https://img.shields.io/pypi/dm/scrapling" alt="PyPI ํจํค์ง ๋ค์ด๋ก๋ ์"></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/ai/agent-skill.html" alt="AI ์์ด์ ํธ์ฉ Skill">+ <img alt="Agent Skill ๋ฐฐ์ง" src="https://img.shields.io/badge/Skill-black?style=flat&label=Agent&link=https%3A%2F%2Fscrapling.readthedocs.io%2Fen%2Flatest%2Fko%2Fai%2Fagent-skill.html"></a>+ <a href="https://clawhub.ai/D4Vinci/scrapling-official" alt="OpenClaw์ฉ Skill">+ <img alt="OpenClaw์ฉ Skill" src="https://img.shields.io/badge/Clawhub-darkred?style=flat&label=OpenClaw&link=https%3A%2F%2Fclawhub.ai%2FD4Vinci%2Fscrapling-official"></a><br/><a href="https://discord.gg/EMgGbDceNQ" alt="Discord" target="_blank"><img alt="Discord" src="https://img.shields.io/discord/1360786381042880532?style=social&logo=discord&link=https%3A%2F%2Fdiscord.gg%2FEMgGbDceNQ"></a>- <a href="https://x.com/Scrapling_dev" alt="X (formerly Twitter)">- <img alt="X (formerly Twitter) Follow" src="https://img.shields.io/twitter/follow/Scrapling_dev?style=social&logo=x&link=https%3A%2F%2Fx.com%2FScrapling_dev">+ <a href="https://x.com/Scrapling_dev" alt="X(๊ตฌ Twitter)">+ <img alt="X(๊ตฌ Twitter) ํ๋ก์ฐ" src="https://img.shields.io/twitter/follow/Scrapling_dev?style=social&logo=x&link=https%3A%2F%2Fx.com%2FScrapling_dev"></a><br/>- <a href="https://pypi.org/project/scrapling/" alt="Supported Python versions">- <img alt="Supported Python versions" src="https://img.shields.io/pypi/pyversions/scrapling.svg"></a>+ <a href="https://pypi.org/project/scrapling/" alt="์ง์ํ๋ Python ๋ฒ์ ">+ <img alt="์ง์ํ๋ Python ๋ฒ์ " src="https://img.shields.io/pypi/pyversions/scrapling.svg"></a></p><p align="center">- <a href="https://scrapling.readthedocs.io/en/latest/parsing/selection.html"><strong>์ ํ ๋ฉ์๋</strong></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/parsing/selection.html"><strong>์์ ์ฐพ๊ธฐ</strong></a>·- <a href="https://scrapling.readthedocs.io/en/latest/fetching/choosing.html"><strong>Fetcher ์ ํ ๊ฐ์ด๋</strong></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/fetching/choosing.html"><strong>Fetcher ์ ํ ๊ฐ์ด๋</strong></a>·- <a href="https://scrapling.readthedocs.io/en/latest/spiders/architecture.html"><strong>Spider</strong></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/spiders/architecture.html"><strong>Spider</strong></a>·- <a href="https://scrapling.readthedocs.io/en/latest/spiders/proxy-blocking.html"><strong>ํ๋ก์ ๋กํ ์ด์ </strong></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/spiders/proxy-blocking.html"><strong>ํ๋ก์ ๊ต์ฒด</strong></a>·- <a href="https://scrapling.readthedocs.io/en/latest/cli/overview.html"><strong>CLI</strong></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/cli/overview.html"><strong>CLI</strong></a>·- <a href="https://scrapling.readthedocs.io/en/latest/ai/mcp-server.html"><strong>MCP ์๋ฒ</strong></a>+ <a href="https://scrapling.readthedocs.io/en/latest/ko/ai/mcp-server.html"><strong>MCP ์๋ฒ</strong></a></p>-Scrapling์ ๋น ๋ฅธ HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ , ๊ฐ๋ ฅํ ํ์ฑ, ๋์ ํฌ๋กค๋ง์ ํ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ด์ Python ์น ์คํฌ๋ํ ํ๋ ์์ํฌ์ ๋๋ค.+Scrapling์ ๋น ๋ฅธ HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ , ๊ฐ๋ ฅํ ํ์ฑ, ๋์ ํฌ๋กค๋ง์ ํ๋๋ก ๋ฌถ์ Python ์น ์คํฌ๋ํ ํ๋ ์์ํฌ์ ๋๋ค.-์ ์ ํ์ด์ง๋ฅผ ์คํฌ๋ํํ๊ณ , JavaScript๋ฅผ ๋ ๋๋งํ๊ณ , ์น์ฌ์ดํธ๋ฅผ ์กฐ์ํ๊ณ , ํ์ด์ง ๋ค์์ ํธ์ถ๋๋ API์ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ์ธ์. ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ ์ธ์ , ํ๋ก์ ๋กํ ์ด์ , ์๋ ์ฌ์๋, ์ผ์์ ์ง/์ฌ๊ฐ, ๋ด์ฅ ๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ ๊ธฐ๋ฅ์ ๊ฐ์ถ ํฌ๋กค๋ฌ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.+์ ์ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ณ , JavaScript๋ฅผ ์คํํ๊ณ , ์ฌ์ดํธ๋ฅผ ์กฐ์ํ๊ณ , ์ฌ์ดํธ๊ฐ ํธ์ถํ๋ API์์ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ์ธ์. ์ธ์ ์ฌ์ฌ์ฉ, ํ๋ก์ ๊ต์ฒด, ์๋ ์ฌ์๋, ์ผ์ ์ ์ง์ ์ฌ๊ฐ, ๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ๋ฅผ ์ง์ํ๋ ํฌ๋กค๋ฌ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.-Python์ด๋ ํฐ๋ฏธ๋์์, ๋๋ MCP ์๋ฒ์ Agent Skill์ ํตํด AI ์์ด์ ํธ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ช ๊ฐ์ ํ๋ ์ถ์ถ๋ถํฐ ์น์ฌ์ดํธ ์ ์ฒด๋ฅผ ๊น๋ํ Markdown์ผ๋ก ์์งํ๋ ์์ ๊น์ง, Scrapling์ด ์คํฌ๋ํ์ ์ ๊ณผ์ ์ ์ง์ํฉ๋๋ค.+Python์ด๋ ํฐ๋ฏธ๋์์ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, MCP ์๋ฒ์ Agent Skill์ ํตํด AI ์์ด์ ํธ์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ช ๊ฐ์ ํ๋๋ฅผ ์ถ์ถํ๋ ์์ ๋ถํฐ ์ฌ์ดํธ ์ ์ฒด๋ฅผ ๊น๋ํ Markdown ํ์ผ๋ก ์ ์ฅํ๋ ์์ ๊น์ง ์ง์ํฉ๋๋ค.## Scrapling์ผ๋ก ํ ์ ์๋ ์ผ-- **[๊ฐ์ ธ์ค๊ธฐ์ ์กฐ์](https://scrapling.readthedocs.io/en/latest/fetching/choosing.html)**: ๋น ๋ฅธ HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ , JavaScript ๋ ๋๋ง, Cloudflare Turnstile/Interstitial ์ฒ๋ฆฌ, ์ธ์ ์ ์ง, ๋ฐฑ๊ทธ๋ผ์ด๋ API ํต์ ์บก์ฒ.-- **[ํ์ฑ๊ณผ ์ถ์ถ](https://scrapling.readthedocs.io/en/latest/parsing/selection.html)**: CSS, XPath, ํ ์คํธ์ ์ ๊ท์ ๊ฒ์, ์ ์ํ ์์ ์ถ์ , ์ ์ฌ ์์ ๋งค์นญ, ๊น๋ํ Markdown ์ถ๋ ฅ.-- **[ํฌ๋กค๋ง๊ณผ ๋ด๋ณด๋ด๊ธฐ](https://scrapling.readthedocs.io/en/latest/spiders/getting-started.html)**: ๋์ ํฌ๋กค๋ง, ํ๋ก์ ๋กํ ์ด์ , ์ฌ์๋, AutoThrottle, ์ผ์์ ์ง/์ฌ๊ฐ, ์คํธ๋ฆฌ๋ฐ, ๋ฐ๋ก ์ธ ์ ์๋ Spider ํ ํ๋ฆฟ, JSON/JSONL/CSV/XML ๋ด๋ณด๋ด๊ธฐ.-- **[AI๋ ํฐ๋ฏธ๋์์ ์คํฌ๋ํ](https://scrapling.readthedocs.io/en/latest/ai/mcp-server.html)**: AI ์์ด์ ํธ๊ฐ ์น์ ํ์ํ๊ณ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ ์ ์๋ MCP ์๋ฒ, Agent Skill, CLI ๋ช ๋ น์ด, ์ธํฐ๋ํฐ๋ธ Shell.+- **[ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ์ ์กฐ์](https://scrapling.readthedocs.io/en/latest/ko/fetching/choosing.html)**: ๋น ๋ฅธ HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ , JavaScript ์คํ, Cloudflare Turnstile๊ณผ Interstitial ์ฒ๋ฆฌ, ์ง์ ์ธ์ , ๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต ๊ธฐ๋ก.+- **[ํ์ฑ๊ณผ ๋ฐ์ดํฐ ์ถ์ถ](https://scrapling.readthedocs.io/en/latest/ko/parsing/selection.html)**: CSS, XPath, ํ ์คํธ์ ์ ๊ท์ ๊ฒ์, ํ์ด์ง๊ฐ ๋ฐ๋ ๋ค์๋ ์์ ์ถ์ , ๋น์ทํ ์์ ์ฐพ๊ธฐ, ๊น๋ํ Markdown ์ถ๋ ฅ.+- **[ํฌ๋กค๋ง๊ณผ ๋ด๋ณด๋ด๊ธฐ](https://scrapling.readthedocs.io/en/latest/ko/spiders/getting-started.html)**: ๋์ ํฌ๋กค๋ง, ํ๋ก์ ๊ต์ฒด, ์ฌ์๋, AutoThrottle, ์ผ์ ์ ์ง์ ์ฌ๊ฐ, ์คํธ๋ฆฌ๋ฐ, ๋ฐ๋ก ์ธ ์ ์๋ ํ ํ๋ฆฟ, JSONยทJSONLยทCSVยทXML ๋ด๋ณด๋ด๊ธฐ.+- **[AI๋ ํฐ๋ฏธ๋์์ ์คํฌ๋ํ](https://scrapling.readthedocs.io/en/latest/ko/ai/mcp-server.html)**: AI ์์ด์ ํธ๊ฐ ์ฌ์ดํธ๋ฅผ ํ์ํ๊ณ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๋ MCP ์๋ฒ, Agent Skill, CLI ๋ช ๋ น์ด, ๋ํํ ์ ธ.-๋จผ์ ํ ํ์ด์ง๋ถํฐ ์์ํ์ธ์:+ํ ํ์ด์ง๋ถํฐ ์์ํ์ธ์:```pythonfrom scrapling.fetchers import Fetcher@@ -72,7 +72,7 @@ quotes = page.css('.quote .text::text').getall()print(quotes)```-๋๋ Spider๋ก ํฌ๋กค๋ง์ ํ์ฅํ์ธ์:+์คํ์ด๋๋ก ์ฌ๋ฌ ํ์ด์ง๋ฅผ ์์งํ ์๋ ์์ต๋๋ค:```pythonfrom scrapling.spiders import Spider, Response@@ -93,7 +93,7 @@ print(len(result.items))result.items.to_json("quotes.json")```-`10`์ด ์ถ๋ ฅ๋๊ณ ๋ช ์ธ๊ณผ ์ ์๊ฐ `quotes.json`์ ์ ์ฅ๋ฉ๋๋ค.+์ด ์ฝ๋๋ `10`์ ์ถ๋ ฅํ๊ณ ๋ช ์ธ๊ณผ ์ ์๋ฅผ `quotes.json`์ ์ ์ฅํฉ๋๋ค.<p align="center"><a href="https://dataimpulse.com/?utm_source=scrapling&utm_medium=banner&utm_campaign=scrapling" target="_blank" style="display:flex; justify-content:center; padding:4px 0;">@@ -119,9 +119,9 @@ result.items.to_json("quotes.json")<img src="https://raw.githubusercontent.com/D4Vinci/Scrapling/main/images/HyperSolutions.png"></a></td>- <td> Scrapling์ Cloudflare Turnstile์ ์ฒ๋ฆฌํฉ๋๋ค. ์ํฐํ๋ผ์ด์ฆ๊ธ ๋ณดํธ๊ฐ ํ์ํ๋ค๋ฉด, <a href="https://hypersolutions.co?utm_source=github&utm_medium=readme&utm_campaign=scrapling">+ <td> Scrapling์ Cloudflare Turnstile์ ์ฒ๋ฆฌํฉ๋๋ค. ๊ธฐ์ ์ฉ ๋ณดํธ ๊ธฐ๋ฅ์ ์ฐํํด์ผ ํ๋ค๋ฉด, <a href="https://hypersolutions.co?utm_source=github&utm_medium=readme&utm_campaign=scrapling"><b>Hyper Solutions</b>- </a>๊ฐ <b>Akamai</b>, <b>DataDome</b>, <b>Kasada</b>, <b>Incapsula</b>์ฉ ์ ํจํ ์ํฐ๋ด ํ ํฐ์ ์์ฑํ๋ API ์๋ํฌ์ธํธ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ฐ๋จํ API ํธ์ถ๋ง์ผ๋ก, ๋ธ๋ผ์ฐ์ ์๋ํ๊ฐ ํ์ ์์ต๋๋ค. </td>+ </a>๊ฐ <b>Akamai</b>, <b>DataDome</b>, <b>Kasada</b>, <b>Incapsula</b>์ฉ ์ ํจํ ์ํฐ๋ด ํ ํฐ์ ์์ฑํ๋ API ์๋ํฌ์ธํธ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ฐ๋จํ API ํธ์ถ๋ง์ผ๋ก ์ฌ์ฉํ ์ ์์ผ๋ฉฐ ๋ธ๋ผ์ฐ์ ์๋ํ๋ ํ์ ์์ต๋๋ค. </td></tr><tr><td width="200">@@ -132,8 +132,8 @@ result.items.to_json("quotes.json")<td><a href="https://evomi.com?utm_source=github&utm_medium=banner&utm_campaign=d4vinci-scrapling"><b>Evomi</b>- </a>: ๋ ์ง๋ด์ ํ๋ก์ GB๋น $0.49๋ถํฐ. ์์ ํ ์์ฅ๋ Chromium ์คํฌ๋ ์ดํ ๋ธ๋ผ์ฐ์ , ๋ ์ง๋ด์ IP, ์๋ CAPTCHA ํด๊ฒฐ, ์ํฐ๋ด ์ฐํ.</br>- <b>Scraper API๋ก ๋ฒ๊ฑฐ๋ก์ ์์ด ๊ฒฐ๊ณผ๋ฅผ ์ป์ผ์ธ์. MCP ๋ฐ N8N ํตํฉ ์ง์.</b>+ </a>: ๋ ์ง๋ด์ ํ๋ก์๋ฅผ GB๋น $0.49๋ถํฐ ์ ๊ณตํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ์์ ํ ์์ฅํ Chromium ๊ธฐ๋ฐ ์คํฌ๋ํ ๋ธ๋ผ์ฐ์ , ๋ ์ง๋ด์ IP, ์๋ CAPTCHA ์ฒ๋ฆฌ, ๋ด ์ฐจ๋จ ์ฐํ๋ฅผ ์ง์ํฉ๋๋ค.</br>+ <b>Scraper API๋ก ๋ฒ๊ฑฐ๋ก์ ์์ด ๊ฒฐ๊ณผ๋ฅผ ์ป์ผ์ธ์. MCP ๋ฐ N8N ์ฐ๋๋ ์ง์ํฉ๋๋ค.</b></td></tr><tr>@@ -143,7 +143,7 @@ result.items.to_json("quotes.json")</a></td><td>- <a href="https://tikhub.io/?utm_source=github.com/D4Vinci/Scrapling&utm_medium=marketing_social&utm_campaign=retargeting&utm_content=carousel_ad" target="_blank">TikHub.io</a>๋ TikTok, X, YouTube, Instagram ๋ฑ 16๊ฐ ์ด์ ํ๋ซํผ์์ 900๊ฐ ์ด์์ ์์ ์ ์ธ API๋ฅผ ์ ๊ณตํ๋ฉฐ, 4,000๋ง ์ด์์ ๋ฐ์ดํฐ์ ์ ๋ณด์ ํ๊ณ ์์ต๋๋ค. <br /> <a href="https://ai.tikhub.io/?ref=KarimShoair" target="_blank">ํ ์ธ๋ AI ๋ชจ๋ธ</a>๋ ์ ๊ณต - Claude, GPT, GEMINI ๋ฑ ์ต๋ 71% ํ ์ธ.+ <a href="https://tikhub.io/?utm_source=github.com/D4Vinci/Scrapling&utm_medium=marketing_social&utm_campaign=retargeting&utm_content=carousel_ad" target="_blank">TikHub.io</a>๋ TikTok, X, YouTube, Instagram ๋ฑ 16๊ฐ ์ด์ ํ๋ซํผ์์ 900๊ฐ ์ด์์ ์์ ์ ์ธ API๋ฅผ ์ ๊ณตํ๋ฉฐ, 4,000๋ง ์ด์์ ๋ฐ์ดํฐ์ ์ ๋ณด์ ํ๊ณ ์์ต๋๋ค. <br /> <a href="https://ai.tikhub.io/?ref=KarimShoair" target="_blank">ํ ์ธ๋ AI ๋ชจ๋ธ</a>๋ ์ ๊ณตํฉ๋๋ค. Claude, GPT, GEMINI ๋ฑ์ ์ต๋ 71% ํ ์ธ๋ ๊ฐ๊ฒฉ์ผ๋ก ์ด์ฉํ ์ ์์ต๋๋ค.</td></tr><tr>@@ -163,7 +163,7 @@ result.items.to_json("quotes.json")</a></td><td>- <a href="https://www.swiftproxy.net/?ref=D4Vinci" target="_blank">Swiftproxy</a>๋ 195๊ฐ๊ตญ ์ด์์์ 8์ฒ๋ง ๊ฐ ์ด์์ IP๋ฅผ ๊ฐ์ถ ํ์ฅ ๊ฐ๋ฅํ ์ฃผ๊ฑฐ์ฉ ํ๋ก์๋ฅผ ์ ๊ณตํ๋ฉฐ, ๋น ๋ฅด๊ณ ์์ ์ ์ธ ์ฐ๊ฒฐ, ์๋ ํ์ , ๊ฐ๋ ฅํ ์ฐจ๋จ ๋ฐฉ์ง ์ฑ๋ฅ์ ์ ๊ณตํฉ๋๋ค. ๋ฌด๋ฃ ์ฒดํํ ์ด์ฉ ๊ฐ๋ฅ.+ <a href="https://www.swiftproxy.net/?ref=D4Vinci" target="_blank">Swiftproxy</a>๋ 195๊ฐ๊ตญ ์ด์์์ 8์ฒ๋ง ๊ฐ ์ด์์ IP๋ฅผ ๊ฐ์ถ ํ์ฅ ๊ฐ๋ฅํ ์ฃผ๊ฑฐ์ฉ ํ๋ก์๋ฅผ ์ ๊ณตํ๋ฉฐ, ๋น ๋ฅด๊ณ ์์ ์ ์ธ ์ฐ๊ฒฐ, ์๋ ํ๋ก์ ๊ต์ฒด, ๊ฐ๋ ฅํ ์ฐจ๋จ ๋ฐฉ์ง ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. ๋ฌด๋ฃ๋ก ์ฒดํํ ์ ์์ต๋๋ค.</td></tr><tr>@@ -183,7 +183,7 @@ result.items.to_json("quotes.json")</a></td><td>- <a href="https://proxylane.dev/?utm_source=scrapling&utm_medium=partnership&utm_campaign=scrapling_platinum_202609&utm_content=github_readme" target="_blank">ProxyLane</a>: ์ฐจ๋จ๊ณผ CAPTCHA๋ฅผ 90% ์ค์ ๋๋ค. ๋๊ท๋ชจ ์น ์คํฌ๋ํ์ ์ํ 2,800๋ง ๊ฐ์ ํ๋ฆฌ๋ฏธ์ ์ฃผ๊ฑฐ์ฉ IP. 195๊ฐ ๊ตญ๊ฐ ์ง์. ๋์, ISP, ์ฐํธ๋ฒํธ(ZIP) ํ๊ฒํ . ๊ณ ์ ๋ฐ ์ํ ์ธ์ . ์ ํจ ๊ธฐ๊ฐ์ด ์๋ ํธ๋ํฝ์ $2/GB๋ถํฐ ์ ๊ณตํฉ๋๋ค. ์ฝ๋ <strong>SCRAPEANDTAKE</strong>๋ฅผ ์ฌ์ฉํ๋ฉด <em>25% ํ ์ธ</em>.+ <a href="https://proxylane.dev/?utm_source=scrapling&utm_medium=partnership&utm_campaign=scrapling_platinum_202609&utm_content=github_readme" target="_blank">ProxyLane</a>: ์ฐจ๋จ๊ณผ CAPTCHA๋ฅผ 90% ์ค์ ๋๋ค. ๋๊ท๋ชจ ์น ์คํฌ๋ํ์ ์ํ 2,800๋ง ๊ฐ์ ํ๋ฆฌ๋ฏธ์ ์ฃผ๊ฑฐ์ฉ IP๋ฅผ ์ ๊ณตํฉ๋๋ค. 195๊ฐ ๊ตญ๊ฐ๋ฅผ ์ง์ํ๋ฉฐ ๋์, ISP, ์ฐํธ๋ฒํธ(ZIP)๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. IP๋ฅผ ์ ์งํ๊ฑฐ๋ ๋ฐ๊พธ๋ ์ธ์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ ํจ ๊ธฐ๊ฐ์ด ์๋ ํธ๋ํฝ์ $2/GB๋ถํฐ ์ ๊ณตํฉ๋๋ค. ์ฝ๋ <strong>SCRAPEANDTAKE</strong>๋ฅผ ์ฌ์ฉํ๋ฉด <em>25% ํ ์ธ</em>์ ๋ฐ์ ์ ์์ต๋๋ค.</td></tr><tr>@@ -193,7 +193,7 @@ result.items.to_json("quotes.json")</a></td><td>- <a href="https://www.lundproxy.com?utm_source=github&utm_medium=sponsorship&utm_campaign=scrapling&utm_content=text" target="_blank">LundProxy</a>: GB๋น ์๊ธ์ ์ด์ ๊ทธ๋ง. ๋ฌด์ ํ ์ฃผ๊ฑฐ์ฉ ํ๋ก์ ํธ๋ํฝ, 1์ต ๊ฐ ์ด์์ IP, 190๊ฐ ์ด์์ ๊ตญ๊ฐ. ๋์ญํญ์ ๋ฐ๋ผ ์๊ธ์ ์ง๋ถํ์ธ์. 50 Mbps ์ฃผ๊ฑฐ์ฉ ํ๋ก์ ๋ฌด๋ฃ ์ฒดํ์ ์ ์ฒญํ์ธ์.+ <a href="https://www.lundproxy.com?utm_source=github&utm_medium=sponsorship&utm_campaign=scrapling&utm_content=text" target="_blank">LundProxy</a>: GB๋น ์๊ธ์ ๋ด์ง ์์๋ ๋ฉ๋๋ค. ๋ฌด์ ํ ์ฃผ๊ฑฐ์ฉ ํ๋ก์ ํธ๋ํฝ๊ณผ 1์ต ๊ฐ ์ด์์ IP๋ฅผ ์ ๊ณตํ๋ฉฐ 190๊ฐ ์ด์์ ๊ตญ๊ฐ๋ฅผ ์ง์ํฉ๋๋ค. ๋์ญํญ์ ๋ฐ๋ผ ์๊ธ์ ์ง๋ถํ์ธ์. 50 Mbps ์ฃผ๊ฑฐ์ฉ ํ๋ก์ ๋ฌด๋ฃ ์ฒดํ์ ์ ์ฒญํ์ธ์.</td></tr><tr>@@ -203,7 +203,7 @@ result.items.to_json("quotes.json")</a></td><td>- <a href="https://dataimpulse.com/?utm_source=website&utm_medium=github_readme&utm_campaign=scrapling_platinum" target="_blank">DataImpulse</a>์์ $1/GB๋ก ์ด์ฉํ์ธ์. ์ค๋ฆฌ์ ์ผ๋ก ํ๋ณดํ ์์ฒด ํ๋ก์. 9,000๋ง ๊ฐ ์ด์์ IP, 195๊ฐ ์ด์์ ๊ตญ๊ฐ. ์ฃผ๊ฑฐ์ฉ, ๋ฐ์ดํฐ์ผํฐ, ๋ชจ๋ฐ์ผ ํ๋ก์. ์ฌ์ฉ๋ ๊ธฐ๋ฐ ์๊ธ = ๊ตฌ๋ ๋ถํ์. ํธ๋ํฝ์ ์ ํจ ๊ธฐ๊ฐ์ด ์์ต๋๋ค.+ <a href="https://dataimpulse.com/?utm_source=website&utm_medium=github_readme&utm_campaign=scrapling_platinum" target="_blank">DataImpulse</a>์์ $1/GB๋ก ์ด์ฉํ์ธ์. ์ค๋ฆฌ์ ์ผ๋ก ํ๋ณดํ ์์ฒด ํ๋ก์๋ฅผ ์ ๊ณตํฉ๋๋ค. 9,000๋ง ๊ฐ ์ด์์ IP์ 195๊ฐ ์ด์์ ๊ตญ๊ฐ๋ฅผ ์ง์ํฉ๋๋ค. ์ฃผ๊ฑฐ์ฉ, ๋ฐ์ดํฐ์ผํฐ, ๋ชจ๋ฐ์ผ ํ๋ก์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ฌ์ฉ๋์ ๋ฐ๋ผ ๊ฒฐ์ ํ๋ฏ๋ก ๊ตฌ๋ ์ด ํ์ ์์ต๋๋ค. ํธ๋ํฝ์ ์ ํจ ๊ธฐ๊ฐ์ด ์์ต๋๋ค.</td></tr></table>@@ -226,68 +226,74 @@ result.items.to_json("quotes.json")<!-- /sponsors -->-<i><sub>์ฌ๊ธฐ์ ๊ด๊ณ ๋ฅผ ๊ฒ์ฌํ๊ณ ์ถ์ผ์ ๊ฐ์? [์ฌ๊ธฐ](https://github.com/sponsors/D4Vinci)๋ฅผ ํด๋ฆญํ๊ณ ์ํ๋ ํฐ์ด๋ฅผ ์ ํํ์ธ์!</sub></i>+<i><sub>์ฌ๊ธฐ์ ๊ด๊ณ ๋ฅผ ๊ฒ์ฌํ๊ณ ์ถ์ผ์ ๊ฐ์? [์ฌ๊ธฐ](https://github.com/sponsors/D4Vinci)๋ฅผ ํด๋ฆญํ๊ณ ์ํ๋ ์๊ธ์ ๋ฅผ ์ ํํ์ธ์!</sub></i>---## ์ฃผ์ ๊ธฐ๋ฅ-### Spider - ๋ณธ๊ฒฉ์ ์ธ ํฌ๋กค๋ง ํ๋ ์์ํฌ-- ๐ท๏ธ **Scrapy ์คํ์ผ Spider API**: `start_urls`, ๋น๋๊ธฐ `parse` ์ฝ๋ฐฑ, `Request`/`Response` ๊ฐ์ฒด๋ก Spider๋ฅผ ์ ์ํฉ๋๋ค.-- โก **๋์ ํฌ๋กค๋ง**: ์ค์ ๊ฐ๋ฅํ ๋์ ์์ฒญ ์ ์ ํ, ๋๋ฉ์ธ๋ณ ์ค๋กํ๋ง, ๋ค์ด๋ก๋ ๋๋ ์ด๋ฅผ ์ง์ํฉ๋๋ค.-- ๐ **๋ฉํฐ ์ธ์ ์ง์**: HTTP ์์ฒญ๊ณผ ์คํ ์ค ํค๋๋ฆฌ์ค ๋ธ๋ผ์ฐ์ ๋ฅผ ํ๋์ ์ธํฐํ์ด์ค๋ก ํตํฉ - ID๋ก ์์ฒญ์ ๋ค๋ฅธ ์ธ์ ์ ๋ผ์ฐํ ํฉ๋๋ค.-- ๐พ **์ผ์์ ์ง์ ์ฌ๊ฐ**: `crawldir`๋ก ๋๊ธฐ ์ค์ธ ์์ฒญ๊ณผ ๋ฐฉ๋ฌธํ URL์ ์ ์ฅํฉ๋๋ค. Ctrl+C๋ก ์ ์ ์ข ๋ฃํ ๋ค ๊ฐ์ ๋๋ ํฐ๋ฆฌ๋ก ๋ค์ ์์ํ์ธ์.-- ๐ก **์คํธ๋ฆฌ๋ฐ ๋ชจ๋**: `async for item in spider.stream()`์ผ๋ก ์คํฌ๋ ์ดํ๋ ์์ดํ ์ ์ค์๊ฐ ํต๊ณ์ ํจ๊ป ์คํธ๋ฆฌ๋ฐ์ผ๋ก ์์ - UI, ํ์ดํ๋ผ์ธ, ์ฅ์๊ฐ ํฌ๋กค๋ง์ ์ ํฉํฉ๋๋ค.-- ๐ก๏ธ **์ฐจ๋จ๋ ์์ฒญ ๊ฐ์ง**: ์ปค์คํ ๋ก์ง์ ํตํ ์ฐจ๋จ๋ ์์ฒญ์ ์๋ ๊ฐ์ง ๋ฐ ์ฌ์๋๋ฅผ ์ง์ํฉ๋๋ค.-- ๐ฆ **AutoThrottle**: ์ง์ฐ ์๊ฐ์ ์ถ์ธกํ ํ์๊ฐ ์์ต๋๋ค. Spider๊ฐ ์ฌ์ดํธ์ ์๋ต ์๋์ ๋ง์ถฐ ๋๋ฉ์ธ๋ณ ์ง์ฐ ์๊ฐ์ ์ค์ค๋ก ์กฐ์ ํ๊ณ , ์ฐจ๋จ์ด๋ ์๋ ์ ํ์ด ์์๋๋ฉด ์ง์ฐ์ ๋ ๋ฐฐ๋ก ๋๋ฆฌ๊ฑฐ๋ `Retry-After`๊ฐ ์๊ตฌํ๋ ๋งํผ ๊ธฐ๋ค๋ ธ๋ค๊ฐ, ์ํฉ์ด ํ๋ฆฌ๋ฉด ๋ค์ ์๋๋ฅผ ์ฌ๋ฆฝ๋๋ค.-- ๐ค **robots.txt ์ค์**: ์ ํ์ `robots_txt_obey` ํ๋๊ทธ๋ก `Disallow`, `Crawl-delay`, `Request-rate` ์ง์๋ฌธ์ ๋๋ฉ์ธ๋ณ ์บ์ฑ๊ณผ ํจ๊ป ์ค์ํฉ๋๋ค.-- ๐งช **๊ฐ๋ฐ ๋ชจ๋**: ์ฒซ ์คํ ์ ์๋ต์ ๋์คํฌ์ ์บ์ฑํ๊ณ ์ดํ ์คํ์์๋ ์บ์๋ ์๋ต์ ์ฌ์ํฉ๋๋ค - ๋์ ์๋ฒ์ ๋ค์ ์์ฒญํ์ง ์๊ณ `parse()` ๋ก์ง์ ๋ฐ๋ณต ๊ฐ๋ฐํ ์ ์์ต๋๋ค.-- ๐งฉ **๋ฐ๋ก ์ฐ๋ Spider ํ ํ๋ฆฟ**: ๋ฐ๋ณต์ ์ธ ์ฝ๋๋ ๊ฑด๋๋ฐ์ธ์. ๊ท์น ๊ธฐ๋ฐ ๋งํฌ ์ถ์ ์๋ `CrawlSpider`, sitemap/robots.txt ๊ธฐ๋ฐ ํฌ๋กค๋ง์๋ `SitemapSpider`, XML/RSS ๋ฐ CSV ํผ๋ ์ํ์๋ `XMLFeedSpider`/`CSVFeedSpider`, ๊ทธ๋ฆฌ๊ณ `ShopifySpider`๋ก ๊ณต๊ฐ๋ Shopify ์คํ ์ด์ ์ํ์ ๋ณํ๋น ํ ํญ๋ชฉ์ฉ ์์งํ ์ ์์ต๋๋ค.-- ๐ **๋งํฌ ์ถ์ถ**: allow/deny ํจํด, ๋๋ฉ์ธ ํํฐ, CSS/XPath ๋ฒ์ ์ง์ , ํ์ฅ์ ํํฐ๋ง, ์ ๊ทํ๋ฅผ ์ง์ํ๋ ๋ ๋ฆฝํ `LinkExtractor`. ํ ํ๋ฆฟ ์์์๋, ๋จ๋ ์ผ๋ก๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.-- ๐ฆ **๋ด์ฅ ๋ด๋ณด๋ด๊ธฐ**: ํ ์ด๋ ์์ฒด ํ์ดํ๋ผ์ธ, ๋๋ ๋ด์ฅ JSON/JSONL/CSV/XML๋ก ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ณด๋ ๋๋ค. `result.items.to_json()`, `to_jsonl()`, `to_csv()`, `to_xml()`์ ์ฌ์ฉํฉ๋๋ค.--### ์ธ์ ์ ์ง์ํ๋ ๊ณ ๊ธ ์น์ฌ์ดํธ ๊ฐ์ ธ์ค๊ธฐ-- **HTTP ์์ฒญ**: `Fetcher` ํด๋์ค๋ก ๋น ๋ฅด๊ณ ์๋ฐํ HTTP ์์ฒญ. ๋ธ๋ผ์ฐ์ ์ TLS fingerprint, ํค๋๋ฅผ ๋ชจ๋ฐฉํ๊ณ , HTTP/3๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.-- **๋์ ๋ก๋ฉ**: Playwright์ Chromium๊ณผ Google Chrome์ ์ง์ํ๋ `StealthyFetcher` ํด๋์ค๋ก ์์ ํ ๋ธ๋ผ์ฐ์ ์๋ํ๋ฅผ ํตํด ๋์ ์น์ฌ์ดํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.-- **์ํฐ๋ด ์ฐํ**: `StealthyFetcher`์ ๊ณ ๊ธ ์คํ ์ค ๊ธฐ๋ฅ๊ณผ ๋ธ๋ผ์ฐ์ ์ง๋ฌธ ์์ฅ. ๋ชจ๋ ์ ํ์ Cloudflare Turnstile/Interstitial์ ์๋์ผ๋ก ์ฝ๊ฒ ์ฐํํ ์ ์์ต๋๋ค.-- **์ธ์ ๊ด๋ฆฌ**: `FetcherSession`, `StealthySession` ํด๋์ค๋ก ์์ฒญ ๊ฐ ์ฟ ํค์ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ ์์์ ์ธ์ ์ ์ง์ํฉ๋๋ค.-- **ํ๋ก์ ๋กํ ์ด์ **: ๋ชจ๋ ์ธ์ ํ์ ์ ๋์ํ๋ ์ํ ๋๋ ์ปค์คํ ์ ๋ต์ ๋ด์ฅ `ProxyRotator`์ ์์ฒญ๋ณ ํ๋ก์ ์ค๋ฒ๋ผ์ด๋๋ฅผ ์ ๊ณตํฉ๋๋ค.-- **๋๋ฉ์ธ ๋ฐ ๊ด๊ณ ์ฐจ๋จ**: ๋ธ๋ผ์ฐ์ ๊ธฐ๋ฐ Fetcher์์ ํน์ ๋๋ฉ์ธ(๋ฐ ํ์ ๋๋ฉ์ธ)์ผ๋ก์ ์์ฒญ์ ์ฐจ๋จํ๊ฑฐ๋ ๋ด์ฅ ๊ด๊ณ ์ฐจ๋จ(์ฝ 3,500๊ฐ์ ์๋ ค์ง ๊ด๊ณ /ํธ๋์ปค ๋๋ฉ์ธ)์ ํ์ฑํํฉ๋๋ค.-- **DNS ์ ์ถ ๋ฐฉ์ง**: ํ๋ก์ ์ฌ์ฉ ์ DNS ์ ์ถ์ ๋ฐฉ์งํ๊ธฐ ์ํด Cloudflare DoH๋ฅผ ํตํด DNS ์ฟผ๋ฆฌ๋ฅผ ๋ผ์ฐํ ํ๋ ์ ํ์ DNS-over-HTTPS ์ง์.-- **์๊ฒฉ ๋ธ๋ผ์ฐ์ **: ๋ก์ปฌ์์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๋์ `cdp_url`๋ก CDP๋ฅผ ํตํด ์ด๋ฏธ ์คํ ์ค์ธ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐํฉ๋๋ค. ๊ฐ์ ์ปดํจํฐ๋ ๋ค๋ฅธ ํธ์คํธ๋ , ๊ด๋ฆฌํ ๋ธ๋ผ์ฐ์ ์๋น์ค๋ ์๊ด์์ต๋๋ค. `executable_path`๋ก ๋ธ๋ผ์ฐ์ ๊ธฐ๋ฐ Fetcher๊ฐ ์ง์ ๋น๋ํ Chromium์ ์ฌ์ฉํ๋๋ก ์ง์ ํ ์๋ ์์ต๋๋ค.-- **๋ฐฑ๊ทธ๋ผ์ด๋ API ์บก์ฒ**: ๋ธ๋ผ์ฐ์ ์ธ์ ์์ `record_requests=True`๋ฅผ ์ผ๊ณ `session.network.search(limit=None)`์ผ๋ก ์ ์ฅ๋ ์๋ต์ ๊ฒ์ํ์ธ์. ์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ ์ฌ๋ฌ ํ์ด์ง๋ฅผ ๋ก๋ํ๋ฉฐ ๋ฐ์ํ API ๋ฐ์ดํฐ์ HTTP ์ค๋ฅ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค. ๊ธฐ๋ก์๋ ์ ์ฅ ํ๋๊ฐ ์์ผ๋ฉฐ ํ ์คํธ ์๋ต ๋ณธ๋ฌธ์ ์ ์ฅํฉ๋๋ค.-- **๋น๋๊ธฐ ์ง์**: ๋ชจ๋ Fetcher์ ์ ์ฉ ๋น๋๊ธฐ ์ธ์ ํด๋์ค์์ ์์ ํ ๋น๋๊ธฐ๋ฅผ ์ง์ํฉ๋๋ค.+### ์คํ์ด๋: ๋ณธ๊ฒฉ์ ์ธ ํฌ๋กค๋ง ํ๋ ์์ํฌ++- ๐ท๏ธ **Scrapy์ ๋น์ทํ Spider API**: `start_urls`, ๋น๋๊ธฐ `parse` ์ฝ๋ฐฑ, `Request`/`Response` ๊ฐ์ฒด๋ก ์คํ์ด๋๋ฅผ ์ ์ํฉ๋๋ค.+- โก **๋์ ํฌ๋กค๋ง**: ๋์์ ์ฒ๋ฆฌํ ์์ฒญ ์, ๋๋ฉ์ธ๋ณ ์ ํ, ๋ค์ด๋ก๋ ์ฌ์ด์ ๋๊ธฐ ์๊ฐ์ ์ค์ ํฉ๋๋ค.+- ๐ **์ฌ๋ฌ ์ธ์ ์ง์**: ํ ์คํ์ด๋์์ HTTP ์์ฒญ๊ณผ ์คํ ์ค ํค๋๋ฆฌ์ค ๋ธ๋ผ์ฐ์ ๋ฅผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ์ธ์ ID๋ก ๊ฐ ์์ฒญ์ ๋ณด๋ผ ์ธ์ ์ ๊ณ ๋ฆ ๋๋ค.+- ๐พ **์ผ์ ์ ์ง์ ์ฌ๊ฐ**: `crawldir`๋ก ๋๊ธฐ ์ค์ธ ์์ฒญ๊ณผ ๋ฐฉ๋ฌธํ URL์ ์ ์ฅํฉ๋๋ค. Ctrl+C๋ก ์์ ํ๊ฒ ๋ฉ์ถ ๋ค ๊ฐ์ ํด๋๋ก ๋ค์ ์์ํ๋ฉด ์ด์ด์ ์คํ๋ฉ๋๋ค.+- ๐ก **์คํธ๋ฆฌ๋ฐ**: `async for item in spider.stream()`์ผ๋ก ์ถ์ถํ ํญ๋ชฉ์ ๋ฐ๋ก ๋ฐ๊ณ ์ค์๊ฐ ํต๊ณ๋ฅผ ํ์ธํฉ๋๋ค. ํ๋ฉด ํ์, ๋ฐ์ดํฐ ์ฒ๋ฆฌ, ๊ธด ํฌ๋กค๋ง ์์ ์ ์ ํฉํฉ๋๋ค.+- ๐ก๏ธ **์ฐจ๋จ ๊ฐ์ง**: ์ฐจ๋จ๋ ์์ฒญ์ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ์ฌ์๋ํฉ๋๋ค. ์ฒ๋ฆฌ ๋ฐฉ์๋ ๋ฐ๊ฟ ์ ์์ต๋๋ค.+- ๐ฆ **AutoThrottle**: ๋๊ธฐ ์๊ฐ์ ์ง์ ์ถ์ธกํ ํ์๊ฐ ์์ต๋๋ค. ์คํ์ด๋๊ฐ ์๋ต ์๋์ ๋ง์ถฐ ๋๋ฉ์ธ๋ณ ๋๊ธฐ ์๊ฐ์ ์กฐ์ ํฉ๋๋ค. ์ฐจ๋จ์ด๋ ์์ฒญ ๋น๋ ์ ํ์ด ์์๋๋ฉด ๋ ๋ฐฐ๋ก ๋๋ฆฌ๊ฑฐ๋ `Retry-After`๊ฐ ์ง์ ํ ์๊ฐ๋งํผ ๊ธฐ๋ค๋ฆฌ๊ณ , ๋ฌธ์ ๊ฐ ์ฌ๋ผ์ง๋ฉด ๋ค์ ์๋๋ฅผ ๋์ ๋๋ค.+- ๐ค **robots.txt ์ค์**: `robots_txt_obey`๋ฅผ ์ผ๋ฉด `Disallow`, `Crawl-delay`, `Request-rate` ๊ท์น์ ๋ฐ๋ฆ ๋๋ค. ๊ท์น์ ๋๋ฉ์ธ๋ณ๋ก ์บ์ํฉ๋๋ค.+- ๐งช **๊ฐ๋ฐ ๋ชจ๋**: ์ฒซ ์คํ์์ ์๋ต์ ๋์คํฌ์ ์ ์ฅํ๊ณ ๋ค์ ์คํ๋ถํฐ ๋ค์ ์ฌ์ฉํฉ๋๋ค. ์๋ฒ์ ๋ค์ ์์ฒญํ์ง ์๊ณ `parse()`๋ฅผ ์์ ํ๋ฉฐ ์ํํ ์ ์์ต๋๋ค.+- ๐งฉ **๋ฐ๋ก ์ฐ๋ ์คํ์ด๋ ํ ํ๋ฆฟ**: `CrawlSpider`๋ ๊ท์น์ ๋ฐ๋ผ ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ๊ณ , `SitemapSpider`๋ sitemap๊ณผ robots.txt๋ฅผ ์ฌ์ฉํฉ๋๋ค. `XMLFeedSpider`/`CSVFeedSpider`๋ XMLยทRSSยทCSV ํผ๋๋ฅผ ์ฝ์ต๋๋ค. `ShopifySpider`๋ ๊ณต๊ฐ Shopify ์คํ ์ด์์ ์ํ์ ์์งํ๋ฉฐ, ์ํ ์ต์ ์กฐํฉ๋ง๋ค ํ ํญ๋ชฉ์ ๋ง๋ญ๋๋ค.+- ๐ **๋งํฌ ์ถ์ถ**: `LinkExtractor`๋ ํ์ฉยท์ ์ธ ํจํด, ๋๋ฉ์ธ ํํฐ, CSSยทXPath ๋ฒ์ ์ง์ , ํ์ฅ์ ํํฐ, URL ์ ๊ทํ๋ฅผ ์ง์ํฉ๋๋ค. ํ ํ๋ฆฟ ์์์ ๋๋ ๋จ๋ ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.+- ๐ฆ **๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ**: ํ ๊ณผ ์์ฒด ์ฒ๋ฆฌ ๊ณผ์ ์ผ๋ก ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ๊ฑฐ๋ ๋ด์ฅ JSONยทJSONLยทCSVยทXML ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ธ์. `result.items.to_json()`, `to_jsonl()`, `to_csv()`, `to_xml()`์ ํธ์ถํ๋ฉด ๋ฉ๋๋ค.++### ์ธ์ ์ ์ฌ์ฉํ ์ฌ์ดํธ ๊ฐ์ ธ์ค๊ธฐ++- **HTTP ์์ฒญ**: `Fetcher`๋ก ๋น ๋ฅด๊ณ ํ์งํ๊ธฐ ์ด๋ ค์ด HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ๋ธ๋ผ์ฐ์ ์ TLS ์ง๋ฌธ๊ณผ ํค๋๋ฅผ ํ๋ด ๋ด๊ณ HTTP/3๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.+- **๋์ ํ์ด์ง**: `StealthyFetcher`๋ก ๋ธ๋ผ์ฐ์ ๋ฅผ ์๋ ์กฐ์ํ๋ฉฐ ๋์ ์ฌ์ดํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค. Playwright์ Chromium๊ณผ Google Chrome์ ์ง์ํฉ๋๋ค.+- **๋ด ์ฐจ๋จ ์ฐํ**: `StealthyFetcher`๋ ์๋ํ ํ์ ์ ์จ๊ธฐ๊ณ ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ์์ฅํฉ๋๋ค. ๋ชจ๋ ์ ํ์ Cloudflare Turnstile๊ณผ Interstitial ๊ฒ์ฌ๋ฅผ ์๋์ผ๋ก ํต๊ณผํ ์ ์์ต๋๋ค.+- **์ธ์ ๊ด๋ฆฌ**: `FetcherSession`๊ณผ `StealthySession`์ ์์ฒญ ์ฌ์ด์ ์ฟ ํค์ ์ํ๋ฅผ ์ ์งํฉ๋๋ค.+- **ํ๋ก์ ๊ต์ฒด**: `ProxyRotator`๋ ๋ชจ๋ ์ธ์ ์์ ํ๋ก์๋ฅผ ์์๋๋ก ๋๋ ์ ํ ๊ท์น์ ๋ฐ๋ผ ๊ต์ฒดํฉ๋๋ค. ์์ฒญ๋ง๋ค ๋ค๋ฅธ ํ๋ก์๋ฅผ ์ง์ ํ ์๋ ์์ต๋๋ค.+- **๋๋ฉ์ธ๊ณผ ๊ด๊ณ ์ฐจ๋จ**: ํน์ ๋๋ฉ์ธ๊ณผ ํ์ ๋๋ฉ์ธ์ผ๋ก ๋ณด๋ด๋ ์์ฒญ์ ๋ง์ ์ ์์ต๋๋ค. ๋ธ๋ผ์ฐ์ Fetcher์ ๊ด๊ณ ์ฐจ๋จ ๊ธฐ๋ฅ์ ์ฝ 3,500๊ฐ์ ๊ด๊ณ ยท์ถ์ ๋๋ฉ์ธ์ ์ฐจ๋จํฉ๋๋ค.+- **DNS ์ ์ถ ๋ฐฉ์ง**: DNS-over-HTTPS๋ฅผ ์ผ๋ฉด Cloudflare์ DoH๋ฅผ ํตํด DNS๋ฅผ ์กฐํํฉ๋๋ค. ํ๋ก์๋ฅผ ์ธ ๋ DNS๊ฐ ์์ด ๋๊ฐ๋ ๊ฒ์ ๋ง์ต๋๋ค.+- **์๊ฒฉ ๋ธ๋ผ์ฐ์ **: `cdp_url`๋ก CDP๋ฅผ ํตํด ์ด๋ฏธ ์คํ ์ค์ธ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐํฉ๋๋ค. ๊ฐ์ ์ปดํจํฐ, ๋ค๋ฅธ ์๋ฒ, ๋ธ๋ผ์ฐ์ ์ ๊ณต ์๋น์ค ์ด๋์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. `executable_path`๋ก ์ง์ ๋ง๋ Chromium์ ๋ธ๋ผ์ฐ์ Fetcher์ ์ง์ ํ ์๋ ์์ต๋๋ค.+- **๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต ๊ธฐ๋ก**: ๋ธ๋ผ์ฐ์ ์ธ์ ์์ `record_requests=True`๋ฅผ ์ผ๊ณ `session.network.search(limit=None)`์ผ๋ก ์ ์ฅ๋ ์๋ต์ ๊ฒ์ํ์ธ์. ์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ ์ฌ๋ฌ ํ์ด์ง์์ ๋ฐ์ํ API ๋ฐ์ดํฐ์ HTTP ์ค๋ฅ๋ฅผ ์ฝ์ ์ ์์ต๋๋ค. ๊ธฐ๋ก์๋ ํฌ๊ธฐ ์ ํ์ด ์์ผ๋ฉฐ ํ ์คํธ ์๋ต ๋ณธ๋ฌธ์ ์ ์ฅํฉ๋๋ค.+- **๋น๋๊ธฐ ์ง์**: ๋ชจ๋ Fetcher์์ ๋น๋๊ธฐ ํธ์ถ์ ์ง์ํ๋ฉฐ, ์ ์ฉ ๋น๋๊ธฐ ์ธ์ ํด๋์ค๋ ์ ๊ณตํฉ๋๋ค.### ํ์ฑ๊ณผ ๋ฐ์ดํฐ ์ถ์ถ-- ๐ **์ค๋งํธ ์์ ์ถ์ **: ์ง๋ฅ์ ์ธ ์ ์ฌ๋ ์๊ณ ๋ฆฌ์ฆ์ผ๋ก ์น์ฌ์ดํธ ๋ณ๊ฒฝ ํ์๋ ์์๋ฅผ ์ฌ๋ฐฐ์นํฉ๋๋ค.-- ๐ฏ **์ ์ฐํ ์ค๋งํธ ์ ํ**: CSS selector, XPath selector, ํํฐ ๊ธฐ๋ฐ ๊ฒ์, ํ ์คํธ ๊ฒ์, ์ ๊ท์ ๊ฒ์ ๋ฑ์ ์ง์ํฉ๋๋ค.-- ๐ **์ ์ฌ ์์ ์ฐพ๊ธฐ**: ๋ฐ๊ฒฌ๋ ์์์ ์ ์ฌํ ์์๋ฅผ ์๋์ผ๋ก ์ฐพ์๋ ๋๋ค.++- ๐ **์์ ์ถ์ **: ์ฌ์ดํธ๊ฐ ๋ฐ๋์ด๋ ์ ์ฌ๋ ์๊ณ ๋ฆฌ์ฆ์ผ๋ก ์์๋ฅผ ๋ค์ ์ฐพ์ต๋๋ค.+- ๐ฏ **์ ์ฐํ ์ ํ**: CSS, XPath, ํํฐ, ํ ์คํธ, ์ ๊ท์ ๋ฑ ์ฌ๋ฌ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+- ๐ **๋น์ทํ ์์ ์ฐพ๊ธฐ**: ์ด๋ฏธ ์ฐพ์ ์์์ ๋น์ทํ ์์๋ฅผ ์๋์ผ๋ก ์ฐพ์ต๋๋ค.### AI ๊ธฐ๋ฅ-- ๐ค **MCP ์๋ฒ**: AI ์ฑ๋ด๊ณผ ์์ด์ ํธ(Claude/Cursor ๋ฑ)๊ฐ Scrapling์ ํตํด ์คํฌ๋ํํ ์ ์์ต๋๋ค. HTTP ์์ฒญ, ๋ธ๋ผ์ฐ์ ์์ , ์คํฌ๋ฆฐ์ท, ์ ์ฅ๋ ๋ก๊ทธ์ธ ์ํ, ๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์์ฒด ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ ์ ์ ํ ๋๊ตฌ๋ก, ์ถฉ๋ถํ ๋ฅ๋ ฅ์ ๊ฐ์ถ AI ๋ชจ๋ธ์ด ์์ ์ค ๋ง์ฃผ์น๋ ์ด๋ค CAPTCHA๋ ์ฐํํ ์ ์๊ฒ ํฉ๋๋ค(์์ฒด Cloudflare ์๋ฒ๋ ๋ฌผ๋ก ์ด๊ณ ์). ์ฌ๋ฌ ๋ฐฉ๋ฒ์ผ๋ก ๋ชจ๋ธ์ ๋ณด๋ด๋ ๋ด์ฉ์ ์ค์ด๊ณ , ๊ด๊ณ ๋ฅผ ์ฐจ๋จํ๊ณ , ํ๋กฌํํธ ์ธ์ ์ ์ผ๋ก๋ถํฐ ๋ชจ๋ธ์ ๋ณดํธํฉ๋๋ค. CDP ์๊ฒฉ ๋ธ๋ผ์ฐ์ ์ ์ธ์ฆ ์ต์ ์ด ์๋ HTTP ์ ์ก๋ ์ง์ํฉ๋๋ค. ([๋ฐ๋ชจ ์์](https://www.youtube.com/watch?v=qyFk3ZNwOxE))-- ๐ง **Agent Skill**: ์ค์น๋ง ํ๋ฉด ๋๋ [Agent Skill](https://scrapling.readthedocs.io/en/latest/ai/agent-skill.html)์ด ์ฝ๋ฉ ์์ด์ ํธ์๊ฒ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ฒด๋ฅผ ๊ฐ๋ฅด์ณ, ์์ด์ ํธ๊ฐ Scrapling์ผ๋ก ์์ฑํ๋ ์ฝ๋๊ฐ ์ถ์ธก์ด ์๋๋ผ ํ์ฌ API์ ๋ง๋๋ก ํด์ค๋๋ค.-- ๐ **RAG์ฉ Markdown**: ํ ์ค(`page.markdown()`)๋ก ์ด๋ค ํ์ด์ง๋ ๊นจ๋ํ๊ณ ์ ์ ๋ LLM์ฉ Markdown์ผ๋ก ๋ณํํ๊ฑฐ๋, `ContentSpider` ํ ํ๋ฆฟ์ผ๋ก ์น์ฌ์ดํธ ์ ์ฒด๋ฅผ Markdown ์ฝํผ์ค๋ก ํฌ๋กค๋งํ ์ ์์ต๋๋ค. ๊ณผ์ ์ LLM์ ์ ํ ์ฌ์ฉํ์ง ์์ต๋๋ค. ([๋ฌธ์](https://scrapling.readthedocs.io/en/latest/ai/building-rag-systems.html))--### ๊ณ ์ฑ๋ฅ & ์ค์ ๊ฒ์ฆ๋ ์ํคํ ์ฒ-- ๐ **์ด๊ณ ์**: ๋๋ถ๋ถ์ Python ์คํฌ๋ ์ดํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ฅ๊ฐํ๋ ์ต์ ํ๋ ์ฑ๋ฅ.-- ๐ **๋ฉ๋ชจ๋ฆฌ ํจ์จ**: ์ต์ ํ๋ ๋ฐ์ดํฐ ๊ตฌ์กฐ์ ์ง์ฐ ๋ก๋ฉ์ผ๋ก ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ์ ์ต์ํํฉ๋๋ค.-- โก **๊ณ ์ JSON ์ง๋ ฌํ**: ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ณด๋ค 10๋ฐฐ ๋น ๋ฆ ๋๋ค.-- ๐๏ธ **์ค์ ๊ฒ์ฆ**: Scrapling์ 92%์ ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง์ ์์ ํ ํ์ ํํธ ์ปค๋ฒ๋ฆฌ์ง๋ฅผ ๊ฐ์ถ๊ณ ์์ ๋ฟ ์๋๋ผ, ์ง๋ 1๋ ๊ฐ ์๋ฐฑ ๋ช ์ Web Scraper๊ฐ ๋งค์ผ ์ฌ์ฉํด ์์ต๋๋ค.--### ๊ฐ๋ฐ์/Web Scraper ์นํ์ ๊ฒฝํ-- ๐ฏ **์ธํฐ๋ํฐ๋ธ Web Scraping Shell**: Scrapling ํตํฉ, ๋จ์ถํค, curl ์์ฒญ์ Scrapling ์์ฒญ์ผ๋ก ๋ณํํ๊ฑฐ๋ ๋ธ๋ผ์ฐ์ ์์ ์์ฒญ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ ๋ฑ์ ๋๊ตฌ๋ฅผ ๊ฐ์ถ ์ ํ์ ๋ด์ฅ IPython Shell๋ก, Web Scraping ์คํฌ๋ฆฝํธ ๊ฐ๋ฐ์ ๊ฐ์ํฉ๋๋ค.-- ๐ **ํฐ๋ฏธ๋์์ ๋ฐ๋ก ์ฌ์ฉ**: ์ฝ๋ ํ ์ค ์์ด Scrapling์ผ๋ก URL์ ์คํฌ๋ ์ดํํ ์ ์์ต๋๋ค!-- ๐ ๏ธ **ํ๋ถํ ๋ด๋น๊ฒ์ด์ API**: ๋ถ๋ชจ, ํ์ , ์์ ํ์ ๋ฉ์๋๋ฅผ ํตํ ๊ณ ๊ธ DOM ์ํ๋ฅผ ์ง์ํฉ๋๋ค.-- ๐งฌ **ํฅ์๋ ํ ์คํธ ์ฒ๋ฆฌ**: ๋ด์ฅ ์ ๊ท์, ํด๋ฆฌ๋ ๋ฉ์๋, ์ต์ ํ๋ ๋ฌธ์์ด ์ฐ์ฐ์ ์ ๊ณตํฉ๋๋ค.-- ๐ **์๋ ์ ๋ ํฐ ์์ฑ**: ๋ชจ๋ ์์์ ๋ํด ๊ฒฌ๊ณ ํ CSS/XPath selector๋ฅผ ์์ฑํฉ๋๋ค.-- ๐ **์ต์ํ API**: Scrapy/Parsel์์ ์ฌ์ฉํ๋ ๊ฒ๊ณผ ๋์ผํ ์์ฌ ์์(pseudo-element)๋ฅผ ๊ฐ์ง Scrapy/BeautifulSoup ์คํ์ผ์ API.-- ๐ค **Scrapy์ ๊ทธ๋๋ก ํตํฉ**: ์ด๋ฏธ Scrapy๋ฅผ ์ฐ๊ณ ๊ณ์ ๊ฐ์? ์ฝ๋ฐฑ์ `scrapling_response` ๋ฐ์ฝ๋ ์ดํฐ๋ง ๋ถ์ด๋ฉด ์ด๋ฏธ ๊ฐ์ ธ์ค๊ณ ์๋ ์๋ต์ Scrapling ํ์๋ก ํ์ฑํ ์ ์์ต๋๋ค. ๋ค์ ์์ฑํ ํ์๊ฐ ์์ต๋๋ค.-- ๐ **์์ ํ ํ์ ์ปค๋ฒ๋ฆฌ์ง**: ๋ฐ์ด๋ IDE ์ง์๊ณผ ์ฝ๋ ์๋์์ฑ์ ์ํ ์์ ํ ํ์ ํํธ. ์ฝ๋๋ฒ ์ด์ค ์ ์ฒด๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค **PyRight**์ **MyPy**๋ก ์๋ ๊ฒ์ฌ๋ฉ๋๋ค.-- ๐ **๋ฐ๋ก ์ฌ์ฉ ๊ฐ๋ฅํ Docker ์ด๋ฏธ์ง**: ๋งค ๋ฆด๋ฆฌ์ค๋ง๋ค ๋ชจ๋ ๋ธ๋ผ์ฐ์ ๋ฅผ ํฌํจํ Docker ์ด๋ฏธ์ง๊ฐ ์๋์ผ๋ก ๋น๋ ๋ฐ ํธ์๋ฉ๋๋ค.++- ๐ค **MCP ์๋ฒ**: Claude๋ Cursor ๊ฐ์ AI ์ฑ๋ด๊ณผ ์์ด์ ํธ๊ฐ Scrapling์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ์์งํฉ๋๋ค. HTTP ์์ฒญ, ๋ธ๋ผ์ฐ์ ์กฐ์, ์คํฌ๋ฆฐ์ท, ์ ์ฅ๋ ๋ก๊ทธ์ธ ์ํ, ๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ ๋๊ตฌ๋ฅผ ํตํด ์ถฉ๋ถํ ๋ฅ๋ ฅ์ ๊ฐ์ง AI ๋ชจ๋ธ์ด ์์ ์ค ๋ง์ฃผ์น๋ ๋ชจ๋ CAPTCHA๋ฅผ ์ฒ๋ฆฌํ๋๋ก ๋์ต๋๋ค. Cloudflare ์ฒ๋ฆฌ ๊ธฐ๋ฅ๋ ๋ด์ฅ๋์ด ์์ต๋๋ค. ๋ชจ๋ธ์ ๋ณด๋ด๋ ๋ด์ฉ์ ์ค์ด๊ณ ๊ด๊ณ ๋ฅผ ์ฐจ๋จํ๋ฉฐ ํ๋กฌํํธ ์ธ์ ์ ์ผ๋ก๋ถํฐ ๋ชจ๋ธ์ ๋ณดํธํฉ๋๋ค. CDP ์๊ฒฉ ๋ธ๋ผ์ฐ์ ์ ์ธ์ฆ์ ์ง์ํ๋ HTTP ์ฐ๊ฒฐ๋ ์ ๊ณตํฉ๋๋ค. ([๋ฐ๋ชจ ์์](https://www.youtube.com/watch?v=qyFk3ZNwOxE))+- ๐ง **Agent Skill**: ์ค์นํด์ ์ฐ๋ [Agent Skill](https://scrapling.readthedocs.io/en/latest/ko/ai/agent-skill.html)์ด ์ฝ๋ฉ ์์ด์ ํธ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ฒด ์ฌ์ฉ๋ฒ์ ์๋ ค ์ค๋๋ค. ์์ด์ ํธ๊ฐ ์ถ์ธก ๋์ ํ์ฌ API์ ๋ง๋ ์ฝ๋๋ฅผ ์์ฑํ๋๋ก ๋์ต๋๋ค.+- ๐ **RAG์ฉ Markdown**: ํ ์ค(`page.markdown()`)๋ก ํ์ด์ง๋ฅผ ์ ๋ฆฌํ๊ณ ์ํํ ๋ด์ฉ์ ์ ๊ฑฐํด LLM์ฉ Markdown์ผ๋ก ๋ง๋ญ๋๋ค. `ContentSpider` ํ ํ๋ฆฟ์ผ๋ก ์ฌ์ดํธ ์ ์ฒด๋ฅผ Markdown ํ์ผ๋ก ์ ์ฅํ ์๋ ์์ต๋๋ค. ์ด ๊ณผ์ ์๋ LLM์ด ํ์ํ์ง ์์ต๋๋ค. ([๋ฌธ์](https://scrapling.readthedocs.io/en/latest/ko/ai/building-rag-systems.html))++### ๋น ๋ฅด๊ณ ์ค๋ฌด์์ ๊ฒ์ฆ๋ ๊ตฌ์กฐ++- ๐ **๋น ๋ฅธ ์ฒ๋ฆฌ**: ์ต์ ํ๋ฅผ ํตํด ๋๋ถ๋ถ์ Python ์คํฌ๋ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ณด๋ค ๋น ๋ฅด๊ฒ ๋์ํฉ๋๋ค.+- ๐ **์ ์ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ**: ์ต์ ํํ ์๋ฃ ๊ตฌ์กฐ๋ฅผ ์ฌ์ฉํ๊ณ ํ์ํ ์์ ์๋ง ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ต๋๋ค.+- โก **๋น ๋ฅธ JSON ๋ณํ**: ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ณด๋ค 10๋ฐฐ ๋น ๋ฆ ๋๋ค.+- ๐๏ธ **์ค๋ฌด ๊ฒ์ฆ**: ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง 92%์ ์ ์ฒด ์ฝ๋์ ํ์ ํํธ๋ฅผ ๊ฐ์ท์ต๋๋ค. ์ง๋ 1๋ ๋์ ์๋ฐฑ ๋ช ์ด ๋งค์ผ ๋ฐ์ดํฐ๋ฅผ ์์งํ๋ ๋ฐ ์ฌ์ฉํ์ต๋๋ค.++### ๊ฐ๋ฐ์๋ฅผ ์ํ ํธ๋ฆฌํ ๋๊ตฌ++- ๐ฏ **๋ํํ ์ ธ**: Scrapling์ ํตํฉํ IPython ์ ธ์ ์ถ๊ฐํ ์ ์์ต๋๋ค. ๋จ์ถ ๋ช ๋ น๊ณผ ๋๊ตฌ๋ก ์คํฌ๋ฆฝํธ๋ฅผ ๋น ๋ฅด๊ฒ ๊ฐ๋ฐํ์ธ์. curl ์์ฒญ์ Scrapling ์์ฒญ์ผ๋ก ๋ฐ๊พธ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ธ๋ผ์ฐ์ ์์ ๋ณผ ์ ์์ต๋๋ค.+- ๐ **ํฐ๋ฏธ๋์์ ๋ฐ๋ก ์ฌ์ฉ**: ์ฝ๋๋ฅผ ํ ์ค๋ ์ฐ์ง ์๊ณ URL์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค!+- ๐ ๏ธ **DOM ํ์**: ๋ถ๋ชจ, ํ์ , ์์ ์์๋ก ์ด๋ํ๋ ๋ฉ์๋๋ฅผ ์ ๊ณตํฉ๋๋ค.+- ๐งฌ **ํ ์คํธ ์ฒ๋ฆฌ**: ์ ๊ท์, ํ ์คํธ ์ ๋ฆฌ, ๋น ๋ฅธ ๋ฌธ์์ด ์ฐ์ฐ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+- ๐ **์ ํ์ ์์ฑ**: ์ด๋ค ์์๋ ์์ ์ ์ธ CSSยทXPath ์ ํ์๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.+- ๐ **์ต์ํ API**: Scrapy์ BeautifulSoup์ ์ต์ํ๋ค๋ฉด ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค. ScrapyยทParsel๊ณผ ๊ฐ์ ๊ฐ์ ์์๋ฅผ ์ง์ํฉ๋๋ค.+- ๐ค **Scrapy ํตํฉ**: ์ฝ๋ฐฑ์ `scrapling_response` ๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ๋ถ์ด๋ฉด ์ด๋ฏธ ๊ฐ์ ธ์จ ์๋ต์ Scrapling ํ์๋ก ์ฒ๋ฆฌํ ์ ์์ต๋๋ค. ์ฝ๋๋ฅผ ์๋ก ์์ฑํ ํ์๊ฐ ์์ต๋๋ค.+- ๐ **์ ์ฒด ํ์ ํํธ**: ํธ์ง๊ธฐ ์ง์๊ณผ ์ฝ๋ ์๋ ์์ฑ์ ๋์ต๋๋ค. ์ฝ๋๊ฐ ๋ฐ๋ ๋๋ง๋ค **PyRight**์ **MyPy**๊ฐ ์ ์ฒด ์ฝ๋๋ฅผ ์๋์ผ๋ก ๊ฒ์ฌํฉ๋๋ค.+- ๐ **๋ฐ๋ก ์ฐ๋ Docker ์ด๋ฏธ์ง**: ์ ๋ฒ์ ๋ง๋ค ๋ชจ๋ ๋ธ๋ผ์ฐ์ ๊ฐ ํฌํจ๋ Docker ์ด๋ฏธ์ง๋ฅผ ์๋์ผ๋ก ๋ง๋ค๊ณ ๋ฐฐํฌํฉ๋๋ค.## ์์ํ๊ธฐ-๊น์ด ๋ค์ด๊ฐ์ง ์๊ณ , Scrapling์ด ํ ์ ์๋ ๊ฒ๋ค์ ๊ฐ๋จํ ์ดํด๋ณด๊ฒ ์ต๋๋ค.+์์ฃผ ์ฐ๋ ๊ธฐ๋ฅ์ ๋ช ๊ฐ์ง ์ดํด๋ณด๊ฒ ์ต๋๋ค.### ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ์ธ์ ์ ์ง์ํ๋ HTTP ์์ฒญ@@ -327,8 +333,8 @@ page = StealthyFetcher.fetch('https://quotes.toscrape.com/')data = page.css('.quote .text::text').getall()```-### Spider-๋์ ์์ฒญ, ์ฌ๋ฌ ์ธ์ ํ์ , ์ผ์์ ์ง & ์ฌ๊ฐ๋ฅผ ๊ฐ์ถ ๋ณธ๊ฒฉ์ ์ธ ํฌ๋กค๋ฌ ๊ตฌ์ถ:+### ์คํ์ด๋+๋์ ์์ฒญ, ์ฌ๋ฌ ์ธ์ , ์ผ์ ์ ์ง์ ์ฌ๊ฐ๋ฅผ ์ง์ํ๋ ํฌ๋กค๋ฌ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค:```pythonfrom scrapling.spiders import Spider, Response@@ -352,7 +358,7 @@ result = QuotesSpider().start()print(f"{len(result.items)}๊ฐ์ ์ธ์ฉ๊ตฌ๋ฅผ ์คํฌ๋ ์ดํํ์ต๋๋ค")result.items.to_json("quotes.json")```-ํ๋์ Spider์์ ์ฌ๋ฌ ์ธ์ ํ์ ์ฌ์ฉ:+ํ ์คํ์ด๋์์ ์ฌ๋ฌ ์ข ๋ฅ์ ์ธ์ ์ ์ฌ์ฉํฉ๋๋ค:```pythonfrom scrapling.spiders import Spider, Request, Responsefrom scrapling.fetchers import FetcherSession, AsyncStealthySession@@ -373,13 +379,13 @@ class MultiSessionSpider(Spider):else:yield Request(link, sid="fast", callback=self.parse) # ๋ช ์์ ์ฝ๋ฐฑ```-์ฒดํฌํฌ์ธํธ๋ฅผ ์ฌ์ฉํด ์ฅ์๊ฐ ํฌ๋กค๋ง์ ์ผ์์ ์ง & ์ฌ๊ฐ:+์งํ ์ํ๋ฅผ ์ ์ฅํ๋ฉด ๊ธด ํฌ๋กค๋ง ์์ ์ ๋ฉ์ท๋ค๊ฐ ์ด์ด์ ์คํํ ์ ์์ต๋๋ค. ๋ค์์ฒ๋ผ ์คํ์ด๋๋ฅผ ์์ํ์ธ์:```pythonQuotesSpider(crawldir="./crawl_data").start()````crawldir`๋ฅผ ์ค์ ํ ๋ค Ctrl+C๋ฅผ ๋๋ฅด๋ฉด ๋๊ธฐ ์ค์ธ ์์ฒญ๊ณผ ๋ฐฉ๋ฌธํ URL์ด ์ ์ฅ๋ฉ๋๋ค. ๊ฐ์ `crawldir`๋ก ๋ค์ ์์ํ๋ฉด ์ด์ด์ ์คํ๋ฉ๋๋ค. ์ถ์ถํ ๋ฐ์ดํฐ๋ ๋ฐ๋ก ์ ์ฅํ์ธ์.-๋๋ ๋ฐ๋ก ์ฐ๋ ํ ํ๋ฆฟ์ผ๋ก ํฌ๋กค๋ง ๋ก์ง ์์ฑ ์์ฒด๋ฅผ ๊ฑด๋๋ธ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด Shopify ์คํ ์ด์ ์ํ ์นดํ๋ก๊ทธ ์ ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด:+๋ฐ๋ก ์ธ ์ ์๋ ํ ํ๋ฆฟ๋ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด Shopify ์คํ ์ด์ ์ ์ฒด ์ํ์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค:```pythonfrom scrapling.spiders import ShopifySpider@@ -388,9 +394,9 @@ class MyStore(ShopifySpider):result = MyStore().start() # ์คํ ์ด์ ๋ชจ๋ ์ํ์ ๋ณํ๋น ํ ํญ๋ชฉ์ฉ ์์ง```-ํ ํ๋ฆฟ์ ๊ณต๊ฐ ์ปฌ๋ ์ API์ ๋ ธ์ถ๋ ์ํ์ ๋ณํ๋น ํ ํญ๋ชฉ์ฉ ์ฝ์ต๋๋ค.+์ด ํ ํ๋ฆฟ์ ๊ณต๊ฐ ์ปฌ๋ ์ API์์ ์ํ์ ์ฝ๊ณ , ์ํ ์ต์ ์กฐํฉ๋ง๋ค ํ ํญ๋ชฉ์ ๋ง๋ญ๋๋ค.-### ๊ณ ๊ธ ํ์ฑ & ๋ด๋น๊ฒ์ด์ +### ๊ณ ๊ธ ํ์ฑ๊ณผ ์์ ํ์```pythonfrom scrapling.fetchers import Fetcher@@ -420,15 +426,15 @@ parent_container = first_quote.parentsimilar_elements = first_quote.find_similar()below_elements = first_quote.below_elements```-์น์ฌ์ดํธ๋ฅผ ๊ฐ์ ธ์ค์ง ์๊ณ ํ์๋ฅผ ๋ฐ๋ก ์ฌ์ฉํ ์๋ ์์ต๋๋ค:+ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค์ง ์๊ณ ํ์๋ฅผ ์ง์ ์ฌ์ฉํ ์๋ ์์ต๋๋ค:```pythonfrom scrapling.parser import Selectorpage = Selector("<html>...</html>")```-์ฌ์ฉ๋ฒ์ ์์ ํ ๋์ผํฉ๋๋ค!+์ฌ์ฉ๋ฒ์ ๊ฐ์ต๋๋ค!-### ๋น๋๊ธฐ ์ธ์ ๊ด๋ฆฌ ์์+### ๋น๋๊ธฐ ์ธ์ ์์ ```pythonimport asynciofrom scrapling.fetchers import FetcherSession, AsyncStealthySession@@ -447,13 +453,13 @@ async def main():asyncio.run(main())```-## CLI & ์ธํฐ๋ํฐ๋ธ Shell+## CLI์ ๋ํํ ์ ธ-Scrapling์๋ ๊ฐ๋ ฅํ ์ปค๋งจ๋๋ผ์ธ ์ธํฐํ์ด์ค๊ฐ ํฌํจ๋์ด ์์ต๋๋ค:+ํฐ๋ฏธ๋์์๋ Scrapling์ ์ฌ์ฉํ ์ ์์ต๋๋ค:[](https://asciinema.org/a/736339)-์ธํฐ๋ํฐ๋ธ Web Scraping Shell ์คํ+์คํฌ๋ํ์ฉ ๋ํํ ์ ธ์ ์คํํฉ๋๋ค:```bashpip install "scrapling[shell]"scrapling shell@@ -467,52 +473,52 @@ scrapling extract fetch 'https://nopecha.com/demo/cloudflare' captchas.html --cs```> [!NOTE]-> MCP ์๋ฒ์ ์ธํฐ๋ํฐ๋ธ Web Scraping Shell ๋ฑ ๋ ๋ง์ ๊ธฐ๋ฅ์ด ์์ง๋ง, ์ด ํ์ด์ง๋ ๊ฐ๊ฒฐํ๊ฒ ์ ์งํ๊ฒ ์ต๋๋ค. ์ ์ฒด ๋ฌธ์๋ [์ฌ๊ธฐ](https://scrapling.readthedocs.io/en/latest/)์์ ํ์ธํ์ธ์.+> MCP ์๋ฒ์ ๋ํํ ์ ธ ๋ฑ ๋ค๋ฅธ ๊ธฐ๋ฅ์ [๋ฌธ์](https://scrapling.readthedocs.io/en/latest/ko/)์์ ํ์ธํ์ธ์.-## ์ฑ๋ฅ ๋ฒค์น๋งํฌ+## ์ฑ๋ฅ ํ ์คํธ-Scrapling์ ๊ฐ๋ ฅํ ๋ฟ๋ง ์๋๋ผ ์ด๊ณ ์์ ๋๋ค. ์๋ ๋ฒค์น๋งํฌ๋ Scrapling์ ํ์๋ฅผ ๋ค๋ฅธ ์ธ๊ธฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ต์ ๋ฒ์ ๊ณผ ๋น๊ตํ ๊ฒ์ ๋๋ค.+Scrapling์ ๊ฐ๋ ฅํ ๋ฟ ์๋๋ผ ๋งค์ฐ ๋น ๋ฆ ๋๋ค. ๋ค์ ํ ์คํธ๋ Scrapling ํ์์ ๋๋ฆฌ ์ฐ์ด๋ ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ต์ ๋ฒ์ ์ ๋น๊ตํฉ๋๋ค.-### ํ ์คํธ ์ถ์ถ ์๋ ํ ์คํธ (5000๊ฐ ์ค์ฒฉ ์์)+### ํ ์คํธ ์ถ์ถ ์๋: ์ค์ฒฉ ์์ 5,000๊ฐ-| # | Library | Time (ms) | vs Scrapling |+| # | ๋ผ์ด๋ธ๋ฌ๋ฆฌ | ์๊ฐ(ms) | Scrapling ๋๋น ||---|:-----------------:|:---------:|:------------:|| 1 | Scrapling | 1.99 | 1.0x || 2 | Parsel/Scrapy | 2.06 | 1.035 |-| 3 | Raw Lxml | 2.56 | 1.286 |+| 3 | Lxml ๋จ๋ | 2.56 | 1.286 || 4 | PyQuery | 23.98 | ~12x || 5 | Selectolax | 197.02 | ~99x || 6 | MechanicalSoup | 1545.15 | ~776.5x |-| 7 | BS4 with Lxml | 1562.1 | ~785.0x |-| 8 | BS4 with html5lib | 3412.73 | ~1714.9x |+| 7 | BS4 + Lxml | 1562.1 | ~785.0x |+| 8 | BS4 + html5lib | 3412.73 | ~1714.9x |-### ์์ ์ ์ฌ๋ & ํ ์คํธ ๊ฒ์ ์ฑ๋ฅ+### ๋น์ทํ ์์ ์ฐพ๊ธฐ์ ํ ์คํธ ๊ฒ์-Scrapling์ ์ ์ํ ์์ ์ฐพ๊ธฐ ๊ธฐ๋ฅ์ ๋์๋ค์ ํฌ๊ฒ ์์ญ๋๋ค:+Scrapling์ ์ ์ํ ์์ ๊ฒ์์ ๋ค๋ฅธ ๋ฐฉ๋ฒ๋ณด๋ค ํจ์ฌ ๋น ๋ฆ ๋๋ค:-| Library | Time (ms) | vs Scrapling |+| ๋ผ์ด๋ธ๋ฌ๋ฆฌ | ์๊ฐ(ms) | Scrapling ๋๋น ||-------------|:---------:|:------------:|| Scrapling | 2.3 | 1.0x || AutoScraper | 12.58 | 5.47x |-> ๋ชจ๋ ๋ฒค์น๋งํฌ๋ 100ํ ์ด์ ์คํ์ ํ๊ท ์ ๋๋ค. ์ธก์ ๋ฐฉ๋ฒ์ [benchmarks.py](https://github.com/D4Vinci/Scrapling/blob/main/benchmarks.py)๋ฅผ ์ฐธ์กฐํ์ธ์.+> ๊ฐ ๊ฒฐ๊ณผ๋ 100ํ ์ด์ ์คํํ ํ๊ท ์ ๋๋ค. ์ธก์ ๋ฐฉ๋ฒ์ [benchmarks.py](https://github.com/D4Vinci/Scrapling/blob/main/benchmarks.py)๋ฅผ ํ์ธํ์ธ์.## ์ค์น-Scrapling์ Python 3.10 ์ด์์ด ํ์ํฉ๋๋ค:+Scrapling์๋ Python 3.10 ์ด์์ด ํ์ํฉ๋๋ค:```bashpip install scrapling```> [!IMPORTANT]-> ์ด ์ค์น์๋ ํ์ ์์ง๊ณผ ์์กด์ฑ๋ง ํฌํจ๋๋ฉฐ, Fetcher๋ ์ปค๋งจ๋๋ผ์ธ ์์กด์ฑ์ ํฌํจ๋์ง ์์ต๋๋ค. ๋ฐ๋ผ์ ์ด ์ค์น๋ง์ผ๋ก๋ ์ ์์ ์ฒ๋ผ `scrapling.fetchers`๋ `scrapling.spiders`์์ ๋ฌด์ธ๊ฐ๋ฅผ ์ํฌํธํ๋ฉด `ModuleNotFoundError`๊ฐ ๋ฐ์ํฉ๋๋ค. Fetcher๋ Spider๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ์๋์ ๊ฐ์ด ๋จผ์ Fetcher ์์กด์ฑ์ ์ค์นํ์ธ์.+> ์ด ๋ช ๋ น์ ํ์์ ํ์ํ ํจํค์ง๋ง ์ค์นํฉ๋๋ค. Fetcher๋ ๋ช ๋ น์ค ๋๊ตฌ๋ ํฌํจ๋์ง ์์ต๋๋ค. ๋ฐ๋ผ์ ์ ์์ ์ฒ๋ผ `scrapling.fetchers`๋ `scrapling.spiders`์์ ๊ฐ์ ธ์ค๋ฉด `ModuleNotFoundError`๊ฐ ๋ฐ์ํฉ๋๋ค. Fetcher๋ ์คํ์ด๋๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋จผ์ ์๋ ๋ฐฉ๋ฒ์ผ๋ก Fetcher์ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ์ธ์.-### ์ ํ์ ์์กด์ฑ+### ์ถ๊ฐ ํจํค์ง-1. ์๋์ ์ถ๊ฐ ๊ธฐ๋ฅ, Fetcher, ๋๋ ๊ด๋ จ ํด๋์ค๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด Fetcher ์์กด์ฑ๊ณผ ๋ธ๋ผ์ฐ์ ์์กด์ฑ์ ๋ค์๊ณผ ๊ฐ์ด ์ค์นํด์ผ ํฉ๋๋ค:+1. Fetcher, ๊ด๋ จ ํด๋์ค, ์๋ ์ถ๊ฐ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด Fetcher์ ๋ธ๋ผ์ฐ์ ์ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ์ธ์:```bashpip install "scrapling[fetchers]"@@ -520,9 +526,9 @@ pip install scraplingscrapling install --force # ๊ฐ์ ์ฌ์ค์น```- ์ด๋ ๊ฒ ํ๋ฉด ๋ชจ๋ ๋ธ๋ผ์ฐ์ ์ ์์คํ ์์กด์ฑ, fingerprint ์กฐ์ ์์กด์ฑ์ด ๋ค์ด๋ก๋๋ฉ๋๋ค.+ ๋ชจ๋ ๋ธ๋ผ์ฐ์ , ํ์ํ ์์คํ ํจํค์ง, ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ๋ฐ๊พธ๋ ๋๊ตฌ๋ฅผ ๋ค์ด๋ก๋ํฉ๋๋ค.- ๋๋ ๋ช ๋ น์ด ๋์ ์ฝ๋์์ ์ค์นํ ์๋ ์์ต๋๋ค:+ ๋ช ๋ น์ด ๋์ ์ฝ๋์์ ์ค์นํ ์๋ ์์ต๋๋ค:```pythonfrom scrapling.cli import install@@ -531,15 +537,15 @@ pip install scrapling```2. ์ถ๊ฐ ๊ธฐ๋ฅ:- - MCP ์๋ฒ ๊ธฐ๋ฅ ์ค์น:+ - MCP ์๋ฒ ์ค์น:```bashpip install "scrapling[ai]"```- - ([RAG ์์คํ ๊ตฌ์ถ](https://scrapling.readthedocs.io/en/latest/ai/building-rag-systems.html))์ ์ํ ์์กด์ฑ ์ค์น:+ - [RAG ์์คํ ๋ง๋ค๊ธฐ](https://scrapling.readthedocs.io/en/latest/ko/ai/building-rag-systems.html)์ ํ์ํ ํจํค์ง ์ค์น:```bashpip install "scrapling[rag]"```- - Shell ๊ธฐ๋ฅ (Web Scraping Shell ๋ฐ `extract` ๋ช ๋ น์ด) ์ค์น:+ - ๋ํํ ์ ธ๊ณผ `extract` ๋ช ๋ น์ด ์ค์น:```bashpip install "scrapling[shell]"```@@ -547,30 +553,30 @@ pip install scrapling```bashpip install "scrapling[all]"```- ๋ธ๋ผ์ฐ์ fetcher๊ฐ ํ์ํ๋ฉด `scrapling install`์ ์คํํ์ธ์. HTTP ์์ฒญ์ ๋ธ๋ผ์ฐ์ ์ค์น๊ฐ ํ์ํ์ง ์์ต๋๋ค.+ ๋ธ๋ผ์ฐ์ Fetcher๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด `scrapling install`์ ์คํํ์ธ์. HTTP ์์ฒญ์๋ ๋ธ๋ผ์ฐ์ ์ค์น๊ฐ ํ์ํ์ง ์์ต๋๋ค.### Docker-DockerHub์์ ๋ชจ๋ ์ถ๊ฐ ๊ธฐ๋ฅ๊ณผ ๋ธ๋ผ์ฐ์ ๊ฐ ํฌํจ๋ Docker ์ด๋ฏธ์ง๋ฅผ ์ค์นํ ์๋ ์์ต๋๋ค:+๋ชจ๋ ์ถ๊ฐ ๊ธฐ๋ฅ๊ณผ ๋ธ๋ผ์ฐ์ ๊ฐ ํฌํจ๋ Docker ์ด๋ฏธ์ง๋ฅผ DockerHub์์ ๋ฐ์ ์๋ ์์ต๋๋ค:```bashdocker pull pyd4vinci/scrapling```-๋๋ GitHub ๋ ์ง์คํธ๋ฆฌ์์ ๋ค์ด๋ก๋:+๋๋ GitHub ๋ ์ง์คํธ๋ฆฌ์์ ๋ฐ์ผ์ธ์:```bashdocker pull ghcr.io/d4vinci/scrapling:latest```-์ด ์ด๋ฏธ์ง๋ GitHub Actions์ ๋ ํฌ์งํ ๋ฆฌ์ main ๋ธ๋์น๋ฅผ ์ฌ์ฉํ์ฌ ์๋์ผ๋ก ๋น๋ ๋ฐ ํธ์๋ฉ๋๋ค.+์ด ์ด๋ฏธ์ง๋ ์ ์ฅ์์ main ๋ธ๋์น๋ฅผ ๋ฐํ์ผ๋ก GitHub Actions์์ ์๋์ผ๋ก ๋ง๋ค๊ณ ๋ฐฐํฌํฉ๋๋ค.-## ๊ธฐ์ฌํ๊ธฐ+## ๊ฐ๋ฐ์ ์ฐธ์ฌํ๊ธฐ-๊ธฐ์ฌ๋ฅผ ํ์ํฉ๋๋ค! ์์ํ๊ธฐ ์ ์ [๊ธฐ์ฌ ๊ฐ์ด๋๋ผ์ธ](https://github.com/D4Vinci/Scrapling/blob/main/CONTRIBUTING.md)์ ์ฝ์ด์ฃผ์ธ์.+๊ฐ๋ฐ ์ฐธ์ฌ๋ฅผ ํ์ํฉ๋๋ค! ์์ํ๊ธฐ ์ ์ [์ฐธ์ฌ ์๋ด](https://github.com/D4Vinci/Scrapling/blob/main/CONTRIBUTING.md)๋ฅผ ์ฝ์ด ์ฃผ์ธ์.## ๋ฉด์ฑ ์กฐํญ> [!CAUTION]-> ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ๊ต์ก ๋ฐ ์ฐ๊ตฌ ๋ชฉ์ ์ผ๋ก๋ง ์ ๊ณต๋ฉ๋๋ค. ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํจ์ผ๋ก์จ, ๊ตญ๋ด์ธ ๋ฐ์ดํฐ ์คํฌ๋ ์ดํ ๋ฐ ๊ฐ์ธ์ ๋ณด ๋ณดํธ ๊ด๋ จ ๋ฒ๋ฅ ์ ์ค์ํ๋ ๋ฐ ๋์ํ ๊ฒ์ผ๋ก ๊ฐ์ฃผ๋ฉ๋๋ค. ์ ์์ ๊ธฐ์ฌ์๋ ์ด ์ํํธ์จ์ด์ ์ค์ฉ์ ๋ํด ์ฑ ์์ง์ง ์์ต๋๋ค. ํญ์ ์น์ฌ์ดํธ์ ์ด์ฉ์ฝ๊ด๊ณผ robots.txt ํ์ผ์ ์กด์คํ์ธ์.+> ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ํ์ต๊ณผ ์ฐ๊ตฌ ๋ชฉ์ ์ผ๋ก ์ ๊ณตํฉ๋๋ค. ์ฌ์ฉํ๋ฉด ๊ตญ๋ด์ธ ๋ฐ์ดํฐ ์์ง๊ณผ ๊ฐ์ธ์ ๋ณด ๋ณดํธ ๊ด๋ จ ๋ฒ๋ฅ ์ ๋ฐ๋ฅด๋ ๋ฐ ๋์ํ ๊ฒ์ผ๋ก ๋ด ๋๋ค. ์์ฑ์์ ์ฐธ์ฌ์๋ ์ํํธ์จ์ด์ ์ค์ฉ์ ์ฑ ์์ง์ง ์์ต๋๋ค. ์ฌ์ดํธ์ ์ด์ฉ ์ฝ๊ด๊ณผ robots.txt๋ฅผ ์ง์ผ ์ฃผ์ธ์.## ๐ ์ธ์ฉ-์ฐ๊ตฌ ๋ชฉ์ ์ผ๋ก ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ จ๋ค๋ฉด, ์๋ ์ฐธ๊ณ ๋ฌธํ์ผ๋ก ์ธ์ฉํด ์ฃผ์ธ์:+์ฐ๊ตฌ์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ๋ค์ ํ์์ผ๋ก ์ธ์ฉํด ์ฃผ์ธ์:```text@misc{scrapling,author = {Karim Shoair},@@ -583,11 +589,11 @@ docker pull ghcr.io/d4vinci/scrapling:latest## ๋ผ์ด์ ์ค-์ด ํ๋ก์ ํธ๋ BSD-3-Clause ๋ผ์ด์ ์ค ํ์ ๋ฐฐํฌ๋ฉ๋๋ค.+์ด ํ๋ก์ ํธ๋ BSD-3-Clause ๋ผ์ด์ ์ค๋ก ๋ฐฐํฌํฉ๋๋ค.## ๊ฐ์ฌ์ ๋ง-์ด ํ๋ก์ ํธ์๋ ๋ค์์์ ์ฐจ์ฉํ ์ฝ๋๊ฐ ํฌํจ๋์ด ์์ต๋๋ค:+๋ค์ ํ๋ก์ ํธ๋ฅผ ๋ฐํ์ผ๋ก ํ ์ฝ๋๊ฐ ํฌํจ๋์ด ์์ต๋๋ค:- Parsel (BSD ๋ผ์ด์ ์ค) - [translator](https://github.com/D4Vinci/Scrapling/blob/main/scrapling/core/translator.py) ์๋ธ๋ชจ๋์ ์ฌ์ฉ---diff --git a/docs/locales/ko/ai/agent-skill.md b/docs/locales/ko/ai/agent-skill.mdnew file mode 100644index 0000000..02378f8--- /dev/null+++ b/docs/locales/ko/ai/agent-skill.md@@ -0,0 +1,42 @@+---+title: "Scrapling Agent Skill ์ค์น์ ์ฌ์ฉ๋ฒ"+description: "์ฝ๋ฉ ์์ด์ ํธ์ Scrapling ์คํฌ์ ์ค์นํ์ธ์. ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ, ํ์ฑ, ํฌ๋กค๋ง์ ํ์ํ ์ต์ API ์์ ์ ์ฐธ๊ณ ์๋ฃ๋ฅผ ์ ๊ณตํฉ๋๋ค."+---++# Scrapling Agent Skill {#scrapling-agent-skill}++[MCP ์๋ฒ](mcp-server.md)๋ AI ์ฑ๋ด์ ์น์ฌ์ดํธ๋ฅผ ์คํฌ๋ํํ๋ ๋๊ตฌ๋ฅผ ์ ๊ณตํฉ๋๋ค. **Scrapling Agent Skill**์ ์ฝ๋ฉ ์์ด์ ํธ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์์ฒด์ ์ฌ์ฉ๋ฒ์ ์๋ ค ์ค๋๋ค. ๋ฐ๋ผ์ ์์ด์ ํธ๊ฐ ์ค๋๋ ํ์ต ๋ฐ์ดํฐ๋ก ์ถ์ธกํ๋ ๋์ , ํ์ฌ API์ ๋ง๋ Scrapling ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.++์ด ์คํฌ์ [AgentSkills](https://agentskills.io/specification) ์ฌ์์ ๋ฐ๋ฅด๋ฏ๋ก [Claude Code](https://claude.com/product/claude-code), [OpenClaw](https://github.com/openclaw/openclaw) ๋ฑ ์ฌ๋ฌ ์์ด์ ํธ ๋๊ตฌ์์ ์ฝ์ ์ ์์ต๋๋ค. ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ, ํ์ฑ, ํฌ๋กค๋ง, MCP, RAG ์๋ด๋ฅผ ํ์ํ ๋ ์ฝ๋ Markdown ์ฐธ๊ณ ์๋ฃ๋ก ๋ฌถ์ด ์ ๊ณตํฉ๋๋ค. ๋ฐ๋ก ์คํํ ์ ์๋ ์์ ๋ ํฌํจ๋์ด ์์ด, ํธ์ง๊ธฐ๋ฅผ ๋ฒ์ด๋์ง ์๊ณ ๋๋ถ๋ถ์ Scrapling ์ง๋ฌธ์ ๋ตํ๊ฑฐ๋ ์ฌ๋ฐ๋ฅธ ์คํฌ๋ํ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.++์คํฌ์ ์ ์ฅ์์ [agent-skill](https://github.com/D4Vinci/Scrapling/tree/main/agent-skill) ๋๋ ํฐ๋ฆฌ์ `scrapling-official`์ด๋ผ๋ ์ด๋ฆ์ผ๋ก ์์ต๋๋ค. ์คํฌ ๋ฒ์ ์ ํญ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฒ์ ์ ๋ง์ถฐ์ง๋๋ค.++## ์ค์น {#installation}++### Skills.sh {#skillssh}++[skills.sh](https://skills.sh) CLI๋ก ์ ์ฅ์์์ ์คํฌ์ ์ค์นํ์ธ์.+```bash+npx skills add D4Vinci/Scrapling --skill scrapling-official+```+CLI๊ฐ ์ค์น๋ ์์ด์ ํธ๋ฅผ ์ฐพ์ ์คํฌ์ ์ถ๊ฐํฉ๋๋ค.++### Clawhub {#clawhub}++OpenClaw๋ฅผ ์ฌ์ฉํ๋ค๋ฉด [Clawhub](https://docs.openclaw.ai/tools/clawhub)๋ก ์ค์นํ ์ ์์ต๋๋ค.+```bash+clawhub install scrapling-official+```+[Clawhub ํ์ด์ง](https://clawhub.ai/D4Vinci/scrapling-official)์์ ์ค์นํ ์๋ ์์ต๋๋ค.++### ์ง์ ๋ค์ด๋ก๋ {#manual-download}++์คํฌ์ ZIP ํ์ผ์ [์ ์ฅ์์์ ์ง์ ๋ค์ด๋ก๋](https://github.com/D4Vinci/Scrapling/raw/refs/heads/main/agent-skill/Scrapling-Skill.zip)ํ ๋ค ์์ด์ ํธ์ ์คํฌ ๋๋ ํฐ๋ฆฌ์ ์์ถ์ ํธ์ธ์. Claude Code์์๋ `~/.claude/skills/`์ ๋๋ค.++## ํฌํจ๋ ๋ด์ฉ {#whats-inside}++- **`SKILL.md`**: ์์ด์ ํธ๊ฐ ๊ฐ์ฅ ๋จผ์ ์ฝ๋ ํ์ผ์ ๋๋ค. ์ค์ ๋ฐฉ๋ฒ, Fetcher ์ ํ, ์ง์ผ์ผ ํ ์์ ๊ท์น์ ์ค๋ช ํฉ๋๋ค. ์๋ฅผ ๋ค์ด ํ๋กฌํํธ ์ธ์ ์ ์ ๋ง๊ธฐ ์ํด CLI ๋ช ๋ น์ ํญ์ `--ai-targeted`๋ฅผ ์ ๋ฌํ๋๋ก ์๋ดํฉ๋๋ค.+- **`references/`**: ํ์ฑ, ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ, Spider, MCP ์๋ฒ, ํตํฉ ๊ธฐ๋ฅ์ ์ค๋ช ํ๋ ๋ฌธ์์ Markdown ์ฌ๋ณธ์ ๋๋ค. ํ์ํ ๋๋ง ์ฝ์ผ๋ฏ๋ก ๊ทธ์ ์๋ ์์ด์ ํธ์ ์ปจํ ์คํธ๋ฅผ ์ฐจ์งํ์ง ์์ต๋๋ค.+- **`examples/`**: ์์ด์ ํธ๊ฐ ๋ณต์ฌํด ์ฌ์ฉํ ์ ์๋ ์คํ ๊ฐ๋ฅํ ์คํฌ๋ฆฝํธ์ ๋๋ค.++์ด ์คํฌ์ OpenClaw์ Claude Code์์ ํ ์คํธํ์ต๋๋ค. ๋ฌธ์ ๊ฐ ์๊ธฐ๋ฉด [์ด์](https://github.com/D4Vinci/Scrapling/issues/new/choose)๋ฅผ ๋ฑ๋กํ๊ฑฐ๋ [Discord ์๋ฒ](https://discord.gg/EMgGbDceNQ)์ ์๋ ค ์ฃผ์ธ์.diff --git a/docs/locales/ko/ai/building-rag-systems.md b/docs/locales/ko/ai/building-rag-systems.mdnew file mode 100644index 0000000..024f8c5--- /dev/null+++ b/docs/locales/ko/ai/building-rag-systems.md@@ -0,0 +1,109 @@+---+title: "Scrapling์ผ๋ก ์น์ฌ์ดํธ๋ฅผ ํฌ๋กค๋งํด RAG์ฉ Markdown ๋ง๋ค๊ธฐ"+description: "ํ์ด์ง ์๋ต์ Markdown์ผ๋ก ๋ฐ๊พธ๊ฑฐ๋ ContentSpider๋ก ์ฌ์ดํธ๋ฅผ ์์งํ์ธ์. RAG ์์คํ ์์ ๋๋๊ณ ์ธ๋ฑ์ฑํ ๋ฌธ์ ๋ชจ์์ ์ค๋นํฉ๋๋ค."+---++# Scrapling์ผ๋ก RAG ์์คํ ๋ง๋ค๊ธฐ {#building-rag-systems-with-scrapling}++RAG ํ์ดํ๋ผ์ธ์ ํ์ง์ ์ ๋ ฅํ๋ ํ ์คํธ์ ๋ฌ๋ ค ์์ต๋๋ค. ์๋ณธ HTML์๋ ๋งํฌ์ , ํ์ ๋ฉ๋ด, ์คํฌ๋ฆฝํธ, ์ถ์ ์ฝ๋ ๊ฐ์ ๋ถํ์ํ ๋ด์ฉ์ด ์์ด ํ ํฐ์ ๋ญ๋นํฉ๋๋ค. ์จ๊ฒจ์ง ํ๋กฌํํธ ์ธ์ ์ ๋ด์ฉ์ด ๊ทธ๋๋ก LLM์ ์ ๋ฌ๋ ์๋ ์์ต๋๋ค. Scrapling์ LLM ์์ด ํ์ด์ง๋ ์ฌ์ดํธ ์ ์ฒด๋ฅผ ์ ๋ฆฌ๋ Markdown์ผ๋ก ๋ฐ๊ฟ๋๋ค. ๋ฐ๋ผ์ ์์ง์ด ๋น ๋ฅด๊ณ ํ์ด์ง๋ง๋ค LLM ๋น์ฉ์ด ๋ค์ง ์์ต๋๋ค.++## ์ค์น {#installation}++```bash+pip install "scrapling[rag]"++scrapling install+```++`rag` ์ถ๊ฐ ์์กด์ฑ ๊ทธ๋ฃน์ Markdown ๋ณํ์ ์ง์ํ๋ Fetcher๋ฅผ ์ค์นํฉ๋๋ค. `ai`, `shell`, `all`์๋ ํฌํจ๋์ด ์์ต๋๋ค. `scrapling install` ๋ช ๋ น์ ๋ธ๋ผ์ฐ์ ์์กด์ฑ์ ๋ค์ด๋ก๋ํฉ๋๋ค. ์ด ๋จ๊ณ๋ ๋ธ๋ผ์ฐ์ ๊ธฐ๋ฐ Fetcher์๋ง ํ์ํฉ๋๋ค.++## ํ ํ์ด์ง๋ฅผ Markdown์ผ๋ก ๋ฐ๊พธ๊ธฐ {#one-page-to-markdown}++๋ชจ๋ [Response](../fetching/choosing.md#response-object)์๋ `markdown()` ๋ฉ์๋๊ฐ ์์ต๋๋ค.++```python+from scrapling.fetchers import Fetcher++markdown = Fetcher.get("https://example.com").markdown(main_content_only=True)+```++๋ชจ๋ Fetcher์์ ์๋ํ๋ฏ๋ก Cloudflare๋ก ๋ณดํธ๋ ํ์ด์ง๋ ํ ์ค๋ก ๋ณํํ ์ ์์ต๋๋ค.++```python+from scrapling.fetchers import StealthyFetcher++markdown = StealthyFetcher.fetch("https://protected.example.com", solve_cloudflare=True).markdown(main_content_only=True)+```++์ถ๋ ฅ์ ๋ ์ธ์๋ก ์กฐ์ ํฉ๋๋ค.++- `main_content_only`: ํ์ด์ง์ `<body>` ํ๊ทธ ์์ ์๋ ๋ด์ฉ๋ง ๋ณํํฉ๋๋ค.+- `css_selector`: CSS ์ ํ์์ ์ผ์นํ๋ ์์๋ง ๋ณํํฉ๋๋ค. ์ผ์นํ๋ ๋ชจ๋ ๊ฒฐ๊ณผ๋ฅผ ํฉ์นฉ๋๋ค. ํ์ดํ๋ผ์ธ์ ํ์ํ ๋ถ๋ถ๋ง ์ถ์ถํด ํ ํฐ์ ์ค์ผ ์ ์์ต๋๋ค.++```python+markdown = Fetcher.get("https://example.com/docs/page").markdown(css_selector="article")+```++์ด๋ค ์ธ์๋ฅผ ์ ๋ฌํ๋ ๋ณํ ์ ์ ์คํฌ๋ฆฝํธ, ์คํ์ผ, ์จ๊ฒจ์ง ๋ด์ฉ์ ํญ์ ์ ๊ฑฐํฉ๋๋ค. [MCP ์๋ฒ](mcp-server.md)๊ฐ AI ์์ด์ ํธ๋ฅผ ํ๋กฌํํธ ์ธ์ ์ ์ผ๋ก๋ถํฐ ๋ณดํธํ ๋๋ ๊ฐ์ ์ ๋ฆฌ ๊ณผ์ ์ ์ฌ์ฉํฉ๋๋ค. ์ธ๋ผ์ธ ์คํ์ผ๋ก ์จ๊ธด ์์, `aria-hidden="true"` ์์, ์จ๊ฒจ์ง ์ฌ๋กฏ, `<template>` ํ๊ทธ, HTML ์ฃผ์, ๋๋น๊ฐ 0์ธ ๋ฌธ์๋ฅผ ๋ณํ ์ ์ ์ ๊ฑฐํฉ๋๋ค. MCP ์๋ฒ๋ `main_content_only=True`์ผ ๋ ์ด ์ ๋ฆฌ ๊ณผ์ ์ ์ฌ์ฉํฉ๋๋ค.++## ์ฌ์ดํธ ์ ์ฒด๋ฅผ Markdown ๋ฌธ์ ๋ชจ์์ผ๋ก ๋ง๋ค๊ธฐ {#a-whole-website-to-a-markdown-corpus}++`ContentSpider` ํ ํ๋ฆฟ์ ์น์ฌ์ดํธ๋ฅผ ํฌ๋กค๋งํ๊ณ ๋ชจ๋ ํ์ด์ง๋ฅผ ๋ณํํฉ๋๋ค. [Spider ํ๋ ์์ํฌ](../spiders/architecture.md)๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ๋์ ์ฒ๋ฆฌ, AutoThrottle, robots.txt ์ค์, ์ผ์ ์ ์ง์ ์ฌ๊ฐ ๊ธฐ๋ฅ๋ ์ด์ฉํ ์ ์์ต๋๋ค.++```python+from scrapling.spiders import ContentSpider++class DocsSpider(ContentSpider):+ name = "docs"+ start_urls = ["https://example.com/docs/"]+ allowed_domains = {"example.com"}+ output_dir = "docs_markdown"+ max_pages = 200++result = DocsSpider().start()+result.items.to_jsonl("docs.jsonl")+```++์์งํ ๊ฐ ํ์ด์ง๋ `url`, `title`, `markdown` ํค๊ฐ ์๋ ํญ๋ชฉ์ด ๋ฉ๋๋ค. `output_dir`๋ฅผ ์ค์ ํ๋ฉด ๊ฐ ํ์ด์ง๋ฅผ URL์ ๋ฐ๋ผ ์ด๋ฆ์ ์ ํ Markdown ํ์ผ๋ก๋ ์ ์ฅํฉ๋๋ค. ๋ฐ๋ผ์ ์ ์์ ๋ `.md` ํ์ผ์ด ๋ด๊ธด ํด๋์ ์์ง ์์คํ ์ ๋ฐ๋ก ๋ฃ์ ์ ์๋ `docs.jsonl`์ ํจ๊ป ๋ง๋ญ๋๋ค.++ํฌ๋กค๋ง์ด ๋์ ์ฌ์ดํธ๋ฅผ ๋ฒ์ด๋์ง ์๋๋ก ์ด ํ ํ๋ฆฟ์๋ `allowed_domains`๊ฐ ํ์ํฉ๋๋ค. ์ฌ์ฉํ ์ ์๋ ์ต์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++- `css_selector` / `main_content_only`: ๋ชจ๋ ํ์ด์ง์ `markdown()`์ ์ ๋ฌํฉ๋๋ค. `main_content_only`๋ ๊ธฐ๋ณธ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.+- `output_dir`: ์ค์ ํ๋ฉด ํ์ด์ง๋ง๋ค Markdown ํ์ผ ํ๋๋ฅผ ์ ์ฅํฉ๋๋ค.+- `max_pages`: ๋ณํํ ํ์ด์ง ์์ ์ํ์ ๋๋ค. ์ํ์ ๋๋ฌํ์ ๋ ์ด๋ฏธ ํ์ ๋ค์ด๊ฐ ์์ฒญ์ ๊ฐ์ ธ์ฌ ์ ์์ง๋ง ๋ณํํ์ง๋ ์์ต๋๋ค. ๊ธฐ๋ณธ๊ฐ์ธ `0`์ ์ ํ์ ๋๋๋ค.++๊ธฐ๋ณธ์ผ๋ก `allowed_domains` ์์ ๋ชจ๋ ํ์ด์ง ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ๋๋ค. ์ด ํ ํ๋ฆฟ์ [CrawlSpider](../spiders/generic-templates.md#crawlspider)๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ฏ๋ก, `rules()`๋ฅผ ์ฌ์ ์ํ๊ณ ์ง์ ์ค์ ํ [LinkExtractor](../spiders/generic-templates.md#linkextractor-reference)๋ก ํฌ๋กค๋ง์ ์กฐ์ ํ ์ ์์ต๋๋ค. `allow`๋ก ์ํ๋ URL ํจํด๋ง ํ์ฉํ๊ณ , `deny`๋ก ๋ก๊ทธ์ธ ํ์ด์ง, ํ๊ทธ ๋ชฉ๋ก, ์ธ์์ฉ ํ์ด์ง ๊ฐ์ ๋ถํ์ํ ํจํด์ ์ ์ธํฉ๋๋ค.++```python+from scrapling.spiders import CrawlRule, LinkExtractor, ContentSpider++class DocsSpider(ContentSpider):+ name = "docs"+ start_urls = ["https://example.com/"]+ allowed_domains = {"example.com"}++ def rules(self):+ return [CrawlRule(LinkExtractor(allow=r"/docs/", deny=[r"/docs/changelog/", r"\?print="]))]+```++`deny`๊ฐ `allow`๋ณด๋ค ์ฐ์ ํฉ๋๋ค. ์ผ๋ฐ **CrawlSpider**์ฒ๋ผ ๊ท์น์ `priority`๋ `process_request` ํ ์ ์ง์ ํ ์๋ ์์ต๋๋ค.++## ๋ฒกํฐ ์ ์ฅ์์ ์ ๋ฌํ๊ธฐ {#feeding-a-vector-store}++JSONL ์ถ๋ ฅ์ ์ด๋ค ์๋ฒ ๋ฉ ํ์ดํ๋ผ์ธ์๋ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ๊ฐ๋จํ ์์ ์ ๋๋ค.++```python+import json++with open("docs.jsonl", encoding="utf-8") as f:+ for line in f:+ page = json.loads(line)+ for chunk in split_into_chunks(page["markdown"]):+ vector_store.add(text=chunk, metadata={"url": page["url"], "title": page["title"]})+```++Spider์ `css_selector`๋ก ํ ์คํธ๋ฅผ ๋๋๊ธฐ ์ ์ ๋ฐ๋ณต๋๋ ๊ณตํต ๋ถ๋ถ์ ์ ๊ฑฐํ์ธ์. ๋ค ๋จ๊ณ์์ ๋ค์ ์ ๋ฆฌํ ํ์๊ฐ ์ค์ด๋ญ๋๋ค. ์๋ฒ ๋ฉ์ ๋ถํ์ํ ๋ด์ฉ์ด ์ ์์๋ก ๊ฒ์ ํ์ง์ด ์ข์์ง๋๋ค.++## ๋ํํ์ผ๋ก ์ฌ์ฉํ๊ธฐ {#interactive-alternatives}++ํ์ดํ๋ผ์ธ ๋์ ๋ํ๋ก ์คํฌ๋ํํ๋ ค๋ฉด [MCP ์๋ฒ](mcp-server.md)๋ฅผ ์ฌ์ฉํ์ธ์. ๊ฐ์ Markdown ์ถ์ถ ๊ธฐ๋ฅ์ AI ์ฑ๋ด์ ๋๊ตฌ๋ก ์ ๊ณตํฉ๋๋ค. [Agent Skill](agent-skill.md)์ ์ฝ๋ฉ ์์ด์ ํธ๊ฐ ์ด๋ฐ ์ฝ๋๋ฅผ ์ง์ ์์ฑํ๋๋ก ๋์ต๋๋ค.diff --git a/docs/locales/ko/ai/mcp-server.md b/docs/locales/ko/ai/mcp-server.mdnew file mode 100644index 0000000..0e11619--- /dev/null+++ b/docs/locales/ko/ai/mcp-server.md@@ -0,0 +1,498 @@+---+title: "Scrapling MCP ์๋ฒ ์ค์ ๊ณผ ์คํฌ๋ํ ์์ "+description: "AI ํด๋ผ์ด์ธํธ๋ฅผ Scrapling์ ์ฐ๊ฒฐํด HTTP์ ๋ธ๋ผ์ฐ์ ๋ก ์คํฌ๋ํํ์ธ์. ์ธ์ , ์ ์ฅํ ๋ก๊ทธ์ธ ์ํ, ๋ธ๋ผ์ฐ์ ๋์, ์ ํ ์ถ์ถ, API ๊ธฐ๋ก์ ์ฌ์ฉํ ์ ์์ต๋๋ค."+---++# Scrapling MCP ์๋ฒ ์๋ด {#scrapling-mcp-server-guide}++<iframe width="560" height="315" src="https://www.youtube.com/embed/qyFk3ZNwOxE?si=3FHzgcYCb66iJ6e3" title="YouTube ๋์์ ํ๋ ์ด์ด" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>++**Scrapling MCP ์๋ฒ**๋ ์ฆ๊ฒจ ์ฐ๋ AI ์ฑ๋ด์ด๋ AI ์์ด์ ํธ์ Scrapling์ ์น ์คํฌ๋ํ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. Claude๋ MCP๋ฅผ ์ง์ํ๋ ์ธํฐํ์ด์ค์์ ๋ํํ๋ฉฐ ์น์ฌ์ดํธ๋ฅผ ์คํฌ๋ํํ๊ณ , ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๊ณ , ๋ด ์ฐจ๋จ์ ์ฐํํ ์ ์์ต๋๋ค.++## ๊ธฐ๋ฅ {#features}++Scrapling MCP ์๋ฒ๋ ์น ์คํฌ๋ํ๊ณผ ๋ธ๋ผ์ฐ์ ์กฐ์์ ์ํ ๋๊ตฌ 16๊ฐ๋ฅผ ์ ๊ณตํฉ๋๋ค. ์ผํ์ฑ ๋๊ตฌ๋ URL ํ๋๋ฅผ ๊ฐ์ ธ์จ ๋ค ์ฌ์ฉํ ๋ธ๋ผ์ฐ์ ๋ ํด๋ผ์ด์ธํธ๋ฅผ ๋ซ์ต๋๋ค. ์ธ์ ๋๊ตฌ๋ ํธ์ถ ์ฌ์ด์ ์ฟ ํค์ ์ค์ ์ ์ ์งํฉ๋๋ค. ๋ฐ๋ผ์ AI๊ฐ ๊ฐ์ ํญ์์ ๋ธ๋ผ์ฐ์ ์์ ์ ์ด์ด ๊ฐ๊ณ ๋คํธ์ํฌ ๊ธฐ๋ก์ ํ์ธํ ์ ์์ต๋๋ค.++### ์ผํ์ฑ ๋๊ตฌ {#one-shot-tools}++#### ๐ ๊ธฐ๋ณธ HTTP ์คํฌ๋ํ {#basic-http-scraping}+- **`make_request`**: ์ฌ๋ฌ ๋ฉ์๋(GET, POST, PUT, DELETE)๋ก ๋น ๋ฅด๊ฒ HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ๋ธ๋ผ์ฐ์ ์ง๋ฌธ ๋ชจ๋ฐฉ, TLS ๋ฒ์ ์ ๋ง๋ ์ค์ ๋ธ๋ผ์ฐ์ ํค๋ ์์ฑ, HTTP/3 ๋ฑ์ ์ง์ํฉ๋๋ค.++#### ๐ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์คํฌ๋ํ {#stealth-browser-scraping}+- **`browser_fetch_once`**: ์คํ ์ค ๋ธ๋ผ์ฐ์ ๋ก JavaScript๋ฅผ ์คํํ๊ณ ๋์ ํ์ด์ง๋ฅผ ์คํฌ๋ํํฉ๋๋ค. ์ง๋ฌธ ์์ฅ, Cloudflare Turnstile/Interstitial ์ฐํ, ๋ธ๋ผ์ฐ์ ์ ์์ฒญ ์ค์ ์ ์ง์ํฉ๋๋ค.++### ์ธ์ ๋๊ตฌ {#session-tools}++#### ๐ ์ธ์ ๊ด๋ฆฌ {#session-management}+- **`browser_open`**: ์ฌ๋ฌ `browser_fetch` ํธ์ถ ์ฌ์ด์ ๊ณ์ ์ด๋ ค ์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์ ๋ง๋ญ๋๋ค. ๋งค๋ฒ ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๋ถ๋ด์ ์ค์ ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ค์ ์ค์ ์ ๋ณด๊ดํ๊ณ `session_id`์ `session_type`๋ง ๋ฐํํฉ๋๋ค. ์ค์ ์ ์ฉ๋ `settings`๋ `list_sessions`๋ก ํ์ธํ์ธ์. CDP ์ธ์ ์์๋ ๋น์ด ์์ต๋๋ค.+- **`open_request_session`**: `session_make_request`์์ ์ฌ์ฉํ๋ ์ง์ HTTP ์ธ์ ์ ๋ง๋ญ๋๋ค. ๋ธ๋ผ์ฐ์ ๋ ์ฌ์ฉํ์ง ์์ผ๋ฉฐ ์์ฒญ ์ฌ์ด์ ์ฟ ํค, ์ฐ๊ฒฐ, ๋ธ๋ผ์ฐ์ ์ง๋ฌธ(`impersonate`)์ ์ ์งํฉ๋๋ค. `session_id`์ `session_type`๋ง ๋ฐํํ๊ณ ํ์ ์ `static`์ ๋๋ค. ์ค์ ์ ์ฉ๋ `settings`๋ `list_sessions`๋ก ํ์ธํ์ธ์.+- **`close_session`**: ๋ธ๋ผ์ฐ์ ๋๋ HTTP ์ธ์ ์ ๋ซ๊ณ ์์์ ํด์ ํฉ๋๋ค.+- **`list_sessions`**: ํ์ฑ ์ธ์ ๊ณผ ๊ฐ ์ธ์ ์ ์ ๋ณด ๋ฐ `settings`๋ฅผ ๋์ดํฉ๋๋ค.++#### ๋ธ๋ผ์ฐ์ ์ํ {#browser-state}++- **`browser_save_state`**: ์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ Playwright ํธํ JSON ํ์ผ๋ก ์ ์ฅํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์ธ์ ์ด ๋๋ ๋ค์๋ ๋ก๊ทธ์ธ ์ํ๋ฅผ ์ฌ์ฌ์ฉํ ์ ์์ต๋๋ค. ๊ธฐ์กด ํ์ผ์ ๋ฎ์ด์๋๋ค.+- **`browser_load_state`**: ์ด๋ ค ์๋ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ ์ฅํ ํ์ผ์ ๋ณต์ํฉ๋๋ค. ์ฒซ ํ์ด์ง๋ฅผ ๋ถ๋ฌ์ค๊ธฐ ์ ์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ํ์ฌ ์ ์ฅ ์ํ๋ฅผ ๋ฐ๊พธ์ง๋ง ๊ธฐ์กด ํญ์ ๋ซ๊ฑฐ๋ ์ด๋ํ์ง๋ ์์ต๋๋ค. ๋ณต์ํ ๋ก๊ทธ์ธ ์ํ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ฑฐ๋ ์๋ก๊ณ ์นจํ์ธ์.++์ํ ํ์ผ์ MCP ์๋ฒ๊ฐ ์คํ๋๋ ์ปดํจํฐ์ ์ ์ฅ๋ฉ๋๋ค. `sessionStorage`, ์ด๋ฆฐ ํญ, ๋ธ๋ผ์ฐ์ ์ค์ ์ ํฌํจํ์ง ์์ต๋๋ค.++#### ๐ฏ ์ธ์ ์ผ๋ก ๊ฐ์ ธ์ค๊ธฐ {#fetching-through-a-session}+- **`browser_fetch`**: ์ด๋ ค ์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์์ JavaScript๋ฅผ ์คํํ๊ณ URL ํ๋๋ฅผ ์คํฌ๋ํํฉ๋๋ค. ์ง๋ฌธ ์์ฅ๊ณผ Cloudflare Turnstile/Interstitial ์ฐํ๋ฅผ ์ง์ํฉ๋๋ค. ์์ ์ฐธ์กฐ, ์์น, ํฌ๊ธฐ๊ฐ ๋ด๊ธด ๊ตฌ์กฐํ๋ ํ์ด์ง ์ค๋ ์ท๋ ๋ง๋ค ์ ์์ต๋๋ค. AI๊ฐ ์กฐ์ํ ๋์์ ์ฐพ๊ณ ๋ง์ฐ์ค ๋์์ ๊ณํํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.+- **`session_make_request`**: ์ฌ๋ฌ ๋ฉ์๋(GET, POST, PUT, DELETE)๋ก ๋น ๋ฅด๊ฒ HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ๋ธ๋ผ์ฐ์ ์ง๋ฌธ ๋ชจ๋ฐฉ, ์ด์ ๋ง๋ ํค๋, HTTP/3๋ฅผ ์ง์ํฉ๋๋ค. `open_request_session`์ผ๋ก ์ฐ ์ธ์ ์์ ์ฟ ํค, ์ฐ๊ฒฐ, ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ์ฌ์ฌ์ฉํฉ๋๋ค.++#### ๐ธ ์คํฌ๋ฆฐ์ท {#screenshots}++- **`browser_screenshot`**: ์๋ก๊ณ ์นจ ์์ด ํ์ฌ ํ์ด์ง๋ ์ ํํ ์์๋ฅผ PNG ๋๋ JPEG๋ก ์บก์ฒํฉ๋๋ค. ์ ๋ ฅํ ํ๋, ์ด๋ฆฐ ๋ฉ๋ด, ์ฐจํธ, ๊ฒฐ๊ณผ ์นด๋๋ฅผ ํ์ธํ ์ ์์ต๋๋ค. ์์๋ง ์บก์ฒํ๋ฉด ๊ด๋ จ ์๋ ์ฃผ๋ณ ๋ด์ฉ์ ์ค์ผ ์ ์์ต๋๋ค. ํ์ฌ ๋ณด์ด๋ ์์ญ, ์ ์ฒด ํ์ด์ง, ์์ ํ๋๋ฅผ ์ง์ํ๋ฉฐ JPEG ํ์ง๋ ์กฐ์ ํ ์ ์์ต๋๋ค. ์คํฌ๋ฆฐ์ท์ ๋ชจ๋ธ์ด ์ง์ ๋ณผ ์ ์๋ ์ค์ ์ด๋ฏธ์ง ์ฝํ ์ธ ๋ธ๋ก์ผ๋ก ๋ฐํ๋ฉ๋๋ค.++#### ํ์ฌ ํ์ด์ง ๋ด์ฉ {#current-page-content}++- **`browser_extract`**: ์๋ก๊ณ ์นจ ์์ด ํ์ฌ ํ์ด์ง๋ ์์ ํ๋๋ฅผ AI ์ค๋ ์ท, HTML, Markdown, ํ ์คํธ๋ก ์ฝ์ต๋๋ค. ํผ์ ์ ๋ ฅํ๊ฑฐ๋ ๋ด์ฉ์ ๋ ๋ถ๋ฌ์จ ๋ค์ ๊ฒฐ๊ณผ๋ ์ถ์ถํ ์ ์์ต๋๋ค. ์ค๋ ์ท์๋ ์ดํ ๋์์ ์ฌ์ฉํ ์์์ ์ญํ , ์ด๋ฆ, ์ฐธ์กฐ, ์์น, ํฌ๊ธฐ๊ฐ ํฌํจ๋ฉ๋๋ค. ์ ๊ท์ ๊ฒ์์ ์ผ์นํ๋ ์ค๋ ์ท ์ค๊ณผ ์ฃผ๋ณ ๋ฌธ๋งฅ, ๋ถ๋ชจ ๋ ธ๋๋ฅผ ๋ฐํํฉ๋๋ค.++#### ๋ธ๋ผ์ฐ์ ๋์ {#browser-actions}++- **`browser_actions`**: ํ ๋ฒ์ ํธ์ถ๋ก ๋ง์ฐ์ค ๋์, ํ๋ ์ ๋ ฅ, ํค๋ณด๋ ๋จ์ถํค, ๋ํ ์์ ์๋ต, ๋๊ธฐ๋ฅผ ์ด์ด์ ์คํํฉ๋๋ค. ์๋ฆผ์ด๋ ํ์ธ ์ฐฝ์ ์๋ฝํ๊ฑฐ๋ ๋ซ๊ณ , ์ ๋ ฅ ๋ํ ์์์ ํ ์คํธ๋ฅผ ๋ฃ์ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ๊ฒ์์ฐฝ ์ ๋ ฅ, ์ ์ถ, ๊ฒฐ๊ณผ ๋๊ธฐ, ๊ฒฐ๊ณผ ์ด๊ธฐ๋ฅผ ํ ๋ฒ์ ์คํํ ์ ์์ต๋๋ค. AI๋ ์ด๋ฏธ ์๊ณ ์๋ ๋จ๊ณ๋ฅผ ๋ฌถ์ด์ ์คํํ๊ณ , ํ์ด์ง ๋ณํ๋ฅผ ํ์ธํ ๋๋ ์ค๋ ์ท์ ๋ฐ๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.++ ๋ง์ฐ์ค๋ฅผ ์ฌ๋ ค ๋ฉ๋ด๋ ํดํ์ ํ์ํ๊ณ , ๋ฒํผ์ด๋ ๋งํฌ๋ฅผ ํด๋ฆญํ๊ณ , ์ค์ฒฉ ํจ๋ ์๋ก ์ด๋ํด ์ธ๋ก๋ ๊ฐ๋ก๋ก ์คํฌ๋กคํ ์ ์์ต๋๋ค. ์ด๋๊ณผ ํด๋ฆญ์๋ ์ ํ์, ์ค๋ ์ท ์ฐธ์กฐ, ์ขํ๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋์์ด ์์๋ผ๋ฉด ์๋์ผ๋ก ๊ธฐ๋ค๋ฆฐ ๋ค ํ๋ฉด ์์ผ๋ก ์คํฌ๋กคํฉ๋๋ค. ์ฌ๋ฌ ๋จ๊ณ์ ์ขํ ์ด๋, ์ผ์ชฝยท์ค๋ฅธ์ชฝยท๊ฐ์ด๋ฐ ๋ฒํผ ํด๋ฆญ, ๋๋ธ ํด๋ฆญ์ ์ง์ํฉ๋๋ค.++ ์ ํ์๋ ์ค๋ ์ท ์ฐธ์กฐ๋ก ํ์ด์ง ์ด๋์ ์๋ ํ๋๋ ์ง์ ํ ์ ์์ต๋๋ค. ํ ์คํธ ์ ๋ ฅ, ์ฒดํฌ๋ฐ์ค ์ ํ๊ณผ ํด์ , ๋ผ๋์ค ๋ฒํผ ์ ํ, ๊ธฐ๋ณธ ๋๋กญ๋ค์ด์์ ๋ณด์ด๋ ๋ผ๋ฒจ๋ก ํ๋ ์ด์์ ์ต์ ์ ํ์ ์ง์ํฉ๋๋ค. ๊ธฐ์กด ํ ์คํธ๋ฅผ ๋ฐ๊พธ๊ฑฐ๋ ์ง์ฐ๊ฑฐ๋ ํ์ฌ ์ปค์ ์์น์์ ์ด์ด ์ธ ์ ์์ต๋๋ค. ํค๋ณด๋ ๋จ์ถํค๋ก ํ ์คํธ ์ ํ๊ณผ ์ญ์ , ํฌ์ปค์ค ์ด๋, ํผ ์ ์ถ, ๋ฉ๋ด ๋ซ๊ธฐ๋ฅผ ํ ์ ์์ต๋๋ค. ๋๋ฆฐ ๋ชจ๋๋ ํ ๊ธ์์ฉ ์ ๋ ฅํ๋ฉฐ ๊ธ์ ์ฌ์ด์ ๋ชจ๋ ๋์ ์ฌ์ด์ ๋ฌด์์๋ก ์ ์ ๋ฉ์ถฅ๋๋ค.++ ๋ค์ ๋์ ์ ์ ๊ฒฐ๊ณผ๊ฐ ๋ํ๋๊ฑฐ๋ ๋ก๋ฉ ์ค๋ฒ๋ ์ด๊ฐ ์ฌ๋ผ์ง๊ฑฐ๋ ํ์ด์ง ๋ก๋ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ ๋๊น์ง ๊ธฐ๋ค๋ฆด ์ ์์ต๋๋ค. ์ ํด์ง ์๊ฐ ๋์ ๋ฉ์ถ๊ธฐ์ ๋คํธ์ํฌ ํ๋์ด ์ฆ์๋ค ๋๊น์ง ๊ธฐ๋ค๋ฆฌ๊ธฐ๋ ์ง์ํฉ๋๋ค.++#### JavaScript {#javascript}++- **`browser_evaluate`**: ํ์ฌ ํ์ด์ง์์ JavaScript๋ฅผ ์คํํด ์ฌ์ฉ์ ์ ์ ๋ฐ์ดํฐ ์ถ์ถ, ๊ณ์ฐ, ํ์ด์ง๋ณ ์์ ์ ์ํํฉ๋๋ค. AI๊ฐ ์ฌ๋ฌ ์์์์ ๋ฐ์ดํฐ๋ฅผ ๋ชจ์ผ๊ฑฐ๋ ์ฑ ์ํ๋ฅผ ์ฝ๊ฑฐ๋ ํ์ด์ง ๋ด์ฉ์ ๋ฐ๊ฟ ์ ์์ต๋๋ค. ๋น๋๊ธฐ ์คํฌ๋ฆฝํธ๋ฅผ ์ง์ํ๊ณ ๊ฒฐ๊ณผ๋ JSON์ผ๋ก ๋ฐํํฉ๋๋ค.++#### ๋คํธ์ํฌ ๊ธฐ๋ก {#network-history}++- **`browser_network_requests`**: ํญ, ํ์ด์ง ๋ก๋, ๋ธ๋ผ์ฐ์ ๋์์ ๊ฑฐ์ณ ์๋ฃ๋ ์์ฒญ์ ์ฐพ์ต๋๋ค. ํ์ด์ง ๋ฐ์ดํฐ์ ์ถ์ฒ์ธ API ํธ์ถ, HTTP ์ค๋ฅ, ์ ์ฅํ ๋ฆฌ๋๋ ์ ์ ํ์ธํ ์ ์์ต๋๋ค. ๊ฒฐ๊ณผ๋ฅผ ์ค์ด๊ธฐ ์ํด ์ ์ ๋ฆฌ์์ค๋ ๊ธฐ๋ณธ์ผ๋ก ์จ๊น๋๋ค. ์์ฒญ ์ ๋ณด๋ฅผ JSON์ผ๋ก ๋ฐํํ๋ฉฐ ๊ธด ๊ธฐ๋ก์ ํ์ด์ง ๋จ์๋ก ์กฐํํ ์ ์์ต๋๋ค.+- **`browser_network_request`**: ๊ธฐ๋กํ ์์ฒญ ํ๋์ ์์ฝ, ํค๋, ๋ณด๋ธ ๋ฐ์ดํฐ, ํ ์คํธ ์๋ต ๋ณธ๋ฌธ์ ๊ตฌ์กฐํ๋ JSON์ผ๋ก ํ์ธํฉ๋๋ค. ํ์ด์ง๋ฅผ ๋ถ๋ฌ์ค๊ฑฐ๋ ์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ ์ ํํ ๋ถ๋ถ์ ์ ๋ถ ๋ฐํํฉ๋๋ค. ์ ์ฅํ ์๋ต์ ํ์ด์ง๊ฐ ๋ฐ๋ ๋ค์๋ ๋จ์ต๋๋ค. ๊ธฐ๋ก ํฌ๊ธฐ์๋ ์ ํ์ด ์์ผ๋ฉฐ ํ ์คํธ๊ฐ ์๋ ๋ณธ๋ฌธ, ๋๋ฌด ํฐ ๋ณธ๋ฌธ, ์ฝ์ ์ ์๋ ๋ณธ๋ฌธ์๋ ์ด์ ๋ฅผ ํ์ํฉ๋๋ค. ํ์ํ ์ ๋ณด๋ MCP ์ธ์ ์ ๋ซ๊ธฐ ์ ์ ์ฝ์ผ์ธ์.++์๋ต ๋ณธ๋ฌธ์ HTML, JSON, XML, JavaScript ๋ฑ ์ง์ํ๋ ํ ์คํธ `Content-Type`์ธ ๊ฒฝ์ฐ์๋ง ์ฝ๊ณ ์ ์ฅํฉ๋๋ค. ๋ฐ์ด๋๋ฆฌ, ์ ์ ์๋ ํ์ , ํ์ ์ด ์๋ ์๋ต์ ๋ณธ๋ฌธ์ ์ฝ๊ฑฐ๋ ์ ์ฅํ์ง ์๊ณ ์์ฒญ ๋ฉํ๋ฐ์ดํฐ์ ํค๋๋ง ๋ณด๊ดํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ๋ ๋ฆฌ์์ค๋ฅผ ํ์์ฒ๋ผ ๋ถ๋ฌ์ต๋๋ค.++์๋ฃ๋ ์์ฒญ๋ง ์ ์ฅํ๋ฉฐ HTTP 4xx์ 5xx ์๋ต๋ ํฌํจํฉ๋๋ค. ์คํจํ๊ฑฐ๋ ์์ง ๋๋์ง ์์ ์์ฒญ์ ์ ์ธํฉ๋๋ค. ๊ธฐ๋ก์ด ๋๋ ๋ค ํญ๋ชฉ์ด ๋ํ๋๋ฉฐ, ๊ธฐ๋ก ์กฐํ๋ ์ธ์ ์ข ๋ฃ๋ ์ด๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์์ต๋๋ค. ํ์ด์ง ์ด๋์ด๋ ์ข ๋ฃ ์์ ์ ๊ธฐ๋ก ์ค์ด๋ ํญ๋ชฉ์ ๋น ์ง ์ ์์ต๋๋ค. ์ ์ฅํ ๋ฐ์ดํธ๋ ๋ธ๋ผ์ฐ์ ์์ ๊ฐ์ ธ์ค๋ฏ๋ก ์๋ฒ๊ฐ ๋ณด๋ธ ๋ฐ์ดํธ์ ๋ค๋ฅผ ์ ์์ต๋๋ค. ์ ํจํ UTF-8์ด๋ผ๋ฉด Playwright์ ๊ฐ์ด UTF-8๋ก ์ฝ๊ณ , ๊ทธ๋ ์ง ์์ผ๋ฉด ๋ช ์๋ ๋ฌธ์ ์ธ์ฝ๋ฉ์ ์ฌ์ฉํฉ๋๋ค.++### Shadow DOM {#shadow-dom}++์ด๋ฆฐ Shadow DOM์ ๋ด์ฉ์ ํฌํจํ๋ ค๋ฉด `browser_fetch_once` ๋๋ ๊ฐ `browser_fetch` ํธ์ถ์ `pierce_shadow=true`๋ฅผ ์ค์ ํ์ธ์. ๊ธฐ๋ณธ๊ฐ์ `false`์ ๋๋ค. ์ ํ์ ์์ ์ ์ ํ ์ฌํญ์ [Shadow DOM](../fetching/stealthy.md#shadow-dom)์ ์ฐธ๊ณ ํ์ธ์.++### ์ฃผ์ ๊ธฐ๋ฅ {#key-capabilities}+- **์ฝํ ์ธ ์ถ์ถ**: ์นํ์ด์ง๋ ์์๋ฅผ Markdown, HTML๋ก ๋ฐ๊พธ๊ฑฐ๋ ์ ๋ฆฌ๋ ํ ์คํธ๋ฅผ ์ถ์ถํฉ๋๋ค.+- **CSS ์ ํ์ ์ง์**: AI์ ์ ๋ฌํ๊ธฐ ์ ์ Scrapling ์์ง์ผ๋ก ํ์ํ ์์๋ฅผ ์ ํํ ๊ณ ๋ฆ ๋๋ค.+- **๋ด ์ฐจ๋จ ์ฐํ**: Cloudflare Turnstile, Interstitial ๋ฑ ์ฌ๋ฌ ๋ณดํธ ๋ฐฉ์์ ๋์ํฉ๋๋ค.+- **ํ๋ก์ ์ง์**: ์ต๋ช ์ฑ์ ๋์ด๊ณ ์ ์ ์ง์ญ์ ์ ํํ ์ ์์ต๋๋ค.+- **๋ธ๋ผ์ฐ์ ๋ชจ๋ฐฉ**: TLS ์ง๋ฌธ, ํด๋น ๋ฒ์ ์ ๋ง๋ ์ค์ ๋ธ๋ผ์ฐ์ ํค๋ ๋ฑ์ ์ฌ์ฉํฉ๋๋ค.+- **์ธ์ ์ ์ง**: ์ฌ๋ฌ ์์ฒญ์์ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ฌ์ฌ์ฉํด ์ฑ๋ฅ์ ๋์ ๋๋ค.+- **๊ด๊ณ ์ฐจ๋จ**: ๋ชจ๋ ๋ธ๋ผ์ฐ์ ๋๊ตฌ๊ฐ ์๋ ค์ง ๊ด๊ณ ยท์ถ์ ๋๋ฉ์ธ ์ฝ 3,500๊ฐ๋ก ๋ณด๋ด๋ ์์ฒญ์ ์๋์ผ๋ก ์ฐจ๋จํด ํ ํฐ์ ์ค์ด๊ณ ํ์ด์ง ๋ก๋๋ฅผ ๋น ๋ฅด๊ฒ ํฉ๋๋ค.+- **ํ๋กฌํํธ ์ธ์ ์ ๋ฐฉ์ง**: ๊ณต๊ฒฉ์ ์ฐ์ผ ์ ์๋ ์จ๊ฒจ์ง ๋ด์ฉ์ ์๋์ผ๋ก ์ ๊ฑฐํฉ๋๋ค. ์ธ๋ผ์ธ ์คํ์ผ๋ก ์จ๊ธด ์์, aria-hidden, ์จ๊ฒจ์ง ์ฌ๋กฏ, ๋๋น๊ฐ 0์ธ ๋ฌธ์, HTML ์ฃผ์, template ํ๊ทธ๊ฐ ๋์์ ๋๋ค.++#### ๋ค๋ฅธ ๋๊ตฌ ๋์ Scrapling MCP ์๋ฒ๋ฅผ ์ฌ์ฉํ๋ ์ด์ {#but-why-use-scrapling-mcp-server-instead-of-other-available-tools}++์คํ ์ค ๊ธฐ๋ฅ๊ณผ Cloudflare Turnstile/Interstitial ์ฐํ ์ธ์๋, Scrapling ์๋ฒ๋ AI์ ์ ๋ฌํ ์์๋ฅผ ์ง์ ๊ณ ๋ฅผ ์ ์์ต๋๋ค. ์ด๋ฐ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ ์ ์ผํ ์๋ฒ์ด๋ฉฐ ์๊ฐ๊ณผ ํ ํฐ์ ํฌ๊ฒ ์ค์ฌ ์ค๋๋ค.++๋ค๋ฅธ ์๋ฒ๋ ๋ด์ฉ์ ์ถ์ถํ ๋ค ๋ชจ๋ AI์ ์ ๋ฌํด ํ์ํ ํญ๋ชฉ์ ์ฐพ๊ฒ ํฉ๋๋ค. ๊ทธ๋ฌ๋ฉด ๊ด๋ จ ์๋ ๋ด์ฉ์๋ ํ ํฐ์ ๋ง์ด ์๋๋ค. Scrapling์ AI์ ์ ๋ฌํ๊ธฐ ์ ์ CSS ์ ํ์๋ก ๋ฒ์๋ฅผ ์ขํ ์ ์์ด ์ ์ฒด ๊ณผ์ ์ด ๋ ๋น ๋ฅด๊ณ ํจ์จ์ ์ ๋๋ค.++CSS ์ ํ์๋ฅผ ์ฐ๋ ๋ฐฉ๋ฒ์ ๋ชฐ๋ผ๋ ๊ด์ฐฎ์ต๋๋ค. ํ๋กฌํํธ์์ AI์๊ฒ ํ์ํ ํญ๋ชฉ์ ๋ง๋ ์ ํ์๋ฅผ ์์ฑํด ๋ฌ๋ผ๊ณ ํ์ธ์. AI๊ฐ ๋ง๋ ์ ํ์๋ฅผ ์ฐพ์ ๋๊น์ง ์ฌ๋ฌ ์กฐํฉ์ ์๋ํ ์ ์์ต๋๋ค. ์๋ ์์ ์์ ๋ณด์ฌ ๋๋ฆฌ๊ฒ ์ต๋๋ค.+++## ์ค์น {#installation}++MCP๋ฅผ ์ง์ํ๋ Scrapling์ ์ค์นํ๊ณ ๋ธ๋ผ์ฐ์ ์์กด์ฑ๋ ์ค์น๋์ด ์๋์ง ํ์ธํ์ธ์.++```bash+# Install Scrapling with MCP server dependencies+pip install "scrapling[ai]"++# Install browser dependencies+scrapling install+```++Docker ๋ ์ง์คํธ๋ฆฌ์ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๋ก ์ฌ์ฉํ ์๋ ์์ต๋๋ค.+```bash+docker pull pyd4vinci/scrapling+```+GitHub ๋ ์ง์คํธ๋ฆฌ์์๋ ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค.+```bash+docker pull ghcr.io/d4vinci/scrapling:latest+```++## MCP ์๋ฒ ์ค์ {#setting-up-the-mcp-server}++์ฌ๊ธฐ์๋ [Claude Desktop](https://claude.ai/download)๊ณผ [Claude Code](https://www.anthropic.com/claude-code)์ Scrapling MCP ์๋ฒ๋ฅผ ์ถ๊ฐํ๋ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค. MCP๋ฅผ ์ง์ํ๋ ๋ค๋ฅธ ์ฑ๋ด๋ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์ค์ ํ ์ ์์ต๋๋ค.++!!! note "์ฐธ๊ณ "+ ์๋์ `scrapling-mcp` ๋ช ๋ น์ v0.4.13์์ ์ถ๊ฐ๋์์ต๋๋ค. `scrapling mcp`๋ฅผ ๋ฐ๋ก ์คํํ๋ ๋จ์ถ ๋ช ๋ น์ผ๋ก, ๋ช ๋ น ํ๋๋ฅผ ์๊ตฌํ๋ MCP ๋ ์ง์คํธ๋ฆฌ๋ ํด๋ผ์ด์ธํธ์ ๋ฑ๋กํ๊ธฐ ์ฝ์ต๋๋ค. ์ด์ ๋ฒ์ ์์๋ `scrapling` ๋ช ๋ น์ ์ฒซ ๋ฒ์งธ ์ธ์๋ก `mcp`๋ฅผ ์ฌ์ฉํ์ธ์.++### Claude Desktop {#claude-desktop}++1. Claude Desktop์ ์ฝ๋๋ค.+2. ์ผ์ชฝ ์ ๋ฉ๋ด(โฐ)์์ Settings โ Developer โ Edit Config๋ฅผ ์ ํํฉ๋๋ค.+3. Scrapling MCP ์๋ฒ ์ค์ ์ ์ถ๊ฐํฉ๋๋ค.+```json+"ScraplingServer": {+ "command": "scrapling-mcp"+}+```+์ฒ์ MCP ์๋ฒ๋ฅผ ์ถ๊ฐํ๋ค๋ฉด ํ์ผ ์ ์ฒด๋ฅผ ๋ค์ ๋ด์ฉ์ผ๋ก ์ค์ ํ์ธ์.+```json+{+ "mcpServers": {+ "ScraplingServer": {+ "command": "scrapling-mcp"+ }+ }+}+```+[๊ณต์ ์๋ด](https://modelcontextprotocol.io/quickstart/user)์ ๋ฐ๋ฅด๋ฉด, ์ด ์์ ์ ๊ธฐ์กด ์ค์ ํ์ผ์ ์ด๊ฑฐ๋ ํ์ผ์ด ์์ผ๋ฉด ์๋ก ๋ง๋ญ๋๋ค. ํ์ผ ์์น๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++1. **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`+2. **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`++ํ์คํ๊ฒ ์คํํ๋ ค๋ฉด `scrapling-mcp` ์คํ ํ์ผ์ ์ ์ฒด ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ์ธ์.++1. **macOS**: `which scrapling-mcp`+2. **Windows**: `where scrapling-mcp`++์ Mac์์๋ `/Users/<MyUsername>/.venv/bin/scrapling-mcp`๊ฐ ๋ฐํ๋์ด ์ต์ข ์ค์ ์ ๋ค์๊ณผ ๊ฐ์ด ์ฌ์ฉํ์ต๋๋ค.+```json+{+ "mcpServers": {+ "ScraplingServer": {+ "command": "/Users/<MyUsername>/.venv/bin/scrapling-mcp"+ }+ }+}+```+#### Docker {#docker}+Docker ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์ค์ ํฉ๋๋ค.+```json+{+ "mcpServers": {+ "ScraplingServer": {+ "command": "docker",+ "args": [+ "run", "-i", "--rm", "pyd4vinci/scrapling", "mcp"+ ]+ }+ }+}+```++[Cursor](https://cursor.com/docs/context/mcp), [WindSurf](https://windsurf.com/university/tutorials/configuring-first-mcp-server) ๋ฑ๋ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์ค์ ํ ์ ์์ต๋๋ค.++### Claude Code {#claude-code}+[Claude Code](https://www.anthropic.com/claude-code)์์๋ ๋ ๊ฐ๋จํฉ๋๋ค.++```bash+claude mcp add ScraplingServer "/Users/<MyUsername>/.venv/bin/scrapling-mcp"+```+Scrapling ์คํ ํ์ผ์ ๊ฒฝ๋ก๋ฅผ ํ์ธํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ ์ฌ์ฉํ์ธ์.++1. **macOS**: `which scrapling-mcp`+2. **Windows**: `where scrapling-mcp`++์์ธํ ๋ด์ฉ์ Anthropic์ [Claude Code์ MCP ์๋ฒ ์ถ๊ฐํ๊ธฐ](https://docs.anthropic.com/en/docs/claude-code/mcp#option-1%3A-add-a-local-stdio-server)๋ฅผ ์ฐธ๊ณ ํ์ธ์.+++์๋ฒ๋ฅผ ์ถ๊ฐํ ๋ค ์ฌ์ฉ ์ค์ธ ์ฑ์ ์์ ํ ์ข ๋ฃํ๊ณ ๋ค์ ์คํํ์ธ์. Claude Desktop์์๋ ์ฑํ ์ ๋ ฅ์ฐฝ ์ค๋ฅธ์ชฝ ์๋์ MCP ์๋ฒ ํ์(๐ง)๊ฐ ๋ํ๋๊ฑฐ๋, ์ ๋ ฅ์ฐฝ์ `Search and tools` ๋ฉ๋ด์ `ScraplingServer`๊ฐ ํ์๋ฉ๋๋ค.++### ๋ค๋ฅธ ๋ธ๋ผ์ฐ์ ์คํ ํ์ผ ์ฌ์ฉํ๊ธฐ {#custom-browser-executable}++`browser_fetch_once`์ `browser_open`์ ๊ธฐ๋ณธ Chromium ๋์ ๋ค๋ฅธ Chromium ํธํ ์คํ ํ์ผ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ฌ์ฉ์ ์ ์ ๋น๋๋ ๊ฐ๋ฒผ์ด ๋ธ๋ผ์ฐ์ ์์ง์ ์ธ ๋ ์ ์ฉํฉ๋๋ค.++MCP ์๋ฒ ์ ์ฒด์ ์ค์ ํ๋ ค๋ฉด ์๋ฒ๋ฅผ ์์ํ ๋ ์คํ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ ๋ฌํ์ธ์.++```bash+scrapling-mcp --executable-path "/path/to/chromium"+```++Claude Desktop ์ค์ ์์๋ ์๋ฒ ์ธ์์ ์ต์ ์ ์ถ๊ฐํฉ๋๋ค.++```json+{+ "mcpServers": {+ "ScraplingServer": {+ "command": "/Users/<MyUsername>/.venv/bin/scrapling-mcp",+ "args": [+ "--executable-path",+ "/path/to/chromium"+ ]+ }+ }+}+```++์๋ฒ๋ฅผ ์์ํ๊ธฐ ์ ์ `SCRAPLING_EXECUTABLE_PATH` ํ๊ฒฝ ๋ณ์๋ฅผ ์ค์ ํ ์๋ ์์ต๋๋ค. ๊ทธ๋๋ AI๋ `browser_fetch_once`๋ก ํ ๋ฒ ๊ฐ์ ธ์ฌ ๋๋ `browser_open`์ผ๋ก ์ธ์ ์ ์ด ๋ ๋ค๋ฅธ ์คํ ํ์ผ์ ์ ํํ ์ ์์ต๋๋ค.++### ์๊ฒฉ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐํ๊ธฐ {#connecting-to-remote-browsers}++`browser_open`์ด ๋ฐ๋์ ๋ก์ปฌ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํด์ผ ํ๋ ๊ฒ์ ์๋๋๋ค. CDP URL์ ์ ๋ฌํ๋ฉด [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/)๋ก ์ด๋ฏธ ์คํ ์ค์ธ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐํฉ๋๋ค. ๊ฐ์ ์ปดํจํฐ, ๋ค๋ฅธ ํธ์คํธ, ๊ด๋ฆฌํ ๋ธ๋ผ์ฐ์ ์๋น์ค ๋ชจ๋ ๊ฐ๋ฅํฉ๋๋ค.+```+Open a stealthy browser session on wss://cdp.provider.example/session/abc123, then use it to scrape the product details from https://shop.example.com. Close the session when you're done.+```+๋ฐํ๋ `session_id`๋ ํ์์ฒ๋ผ `browser_fetch`, `browser_extract`, `browser_actions`, `browser_evaluate`, `browser_screenshot`, `browser_network_requests`, `browser_network_request`, `browser_save_state`, `browser_load_state`์ ์ฌ์ฉํฉ๋๋ค.++URL์๋ ๋ธ๋ผ์ฐ์ ์๋น์ค์์ ์ ๊ณตํ๋ WebSocket ์ฃผ์(`ws://`/`wss://`)๋, ์๊ฒฉ ๋๋ฒ๊น ํฌํธ๋ฅผ ์ผ๊ณ ์ง์ ์คํํ ๋ธ๋ผ์ฐ์ ์ HTTP ์ฃผ์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.+```commandline+chrome --remote-debugging-port=9222+```+์ด ๋ธ๋ผ์ฐ์ ์๋ `cdp_url="http://localhost:9222"`๋ก ์ฐ๊ฒฐํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ๊ฐ ๋ค๋ฅธ ์ปดํจํฐ์์ ์คํ ์ค์ด๋ฉด ํด๋น ํธ์คํธ์ ์ฃผ์๋ฅผ ์ฌ์ฉํ์ธ์.++!!! note "์ฐธ๊ณ :"++ * ๋ธ๋ผ์ฐ์ ๊ฐ ์ด๋ฏธ ์คํ ์ค์ด๋ฏ๋ก ์คํํ ๋๋ง ์ฐ๋ ์ต์ ์ CDP ์ธ์ ์์ ๋ฌด์๋ฉ๋๋ค. `headless`, `real_chrome`, `executable_path`๊ฐ ์ด์ ํด๋นํ๋ฉฐ, ์์์ ์ค๋ช ํ ์๋ฒ ์ ์ฒด ๊ธฐ๋ณธ ๊ฒฝ๋ก๋ ํฌํจ๋ฉ๋๋ค.<br/>+ * ๊ฐ ์ธ์ ์ด ์๊ฒฉ ๋ธ๋ผ์ฐ์ ์ ๋ณ๋์ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ๋ฅผ ๋ง๋ค๊ธฐ ๋๋ฌธ์ ๋๋จธ์ง ์ต์ (`locale`, `useragent`, `proxy`, `cookies`, `timezone_id` ๋ฑ)์ ๊ทธ๋๋ก ์ ์ฉ๋ฉ๋๋ค.++### Streamable HTTP {#streamable-http}+๋ฒ์ 0.3.6๋ถํฐ ๊ธฐ์กด 'stdio' ์ ์ก ๋ฐฉ์ ๋์ 'Streamable HTTP' ์ ์ก ๋ฐฉ์์ผ๋ก MCP ์๋ฒ๋ฅผ ์คํํ ์ ์์ต๋๋ค.++๋ค์ 'stdio' ๋ช ๋ น ๋์ :+```bash+scrapling-mcp+```+์๋ ๋ช ๋ น์ผ๋ก 'Streamable HTTP' ์ ์ก ๋ฐฉ์์ ์ผ์ธ์.+```bash+scrapling-mcp --http+```+์๋ฒ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ํธ์คํธ '127.0.0.1'์ ํฌํธ 8000์์ ์ฐ๊ฒฐ์ ๋ฐ์ต๋๋ค. ๋ ๊ฐ์ ๋ค์๊ณผ ๊ฐ์ด ๋ฐ๊ฟ ์ ์์ต๋๋ค.+```bash+scrapling-mcp --http --host '0.0.0.0' --port 8000+```+๊ธฐ๋ณธ ์ค์ ์์๋ ๊ฐ์ ์ปดํจํฐ์ ์ฐ๊ฒฐ๋ง ๋ฐ์ต๋๋ค. ๋คํธ์ํฌ์์ ์๋ฒ์ ์ฐ๊ฒฐํ ์ ์๊ฒ ํ๋ ค๋ฉด `--host '0.0.0.0'`์ ์ ๋ฌํ์ธ์. ์ด ์ค์ ๊ณผ ์๋์ ์ธ์ฆ ์ค์ ์ ๋ณ๊ฐ์ ๋๋ค.++Docker ์์์ 'Streamable HTTP'๋ฅผ ์คํํ๋ ค๋ฉด ์ง์ '0.0.0.0'์ ๋ฐ์ธ๋ฉํ๊ณ ํ ํฐ์ ์ค์ ํด์ผ ํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ๊ณต๊ฐํ ํฌํธ์์ ์๋ฒ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ์ปจํ ์ด๋์ '127.0.0.1'์ ์ปจํ ์ด๋ ์์์๋ง ์ ๊ทผํ ์ ์๊ธฐ ๋๋ฌธ์ ๋๋ค.+```bash+docker run -p 8000:8000 -e SCRAPLING_MCP_AUTH_TOKEN="<your-token>" pyd4vinci/scrapling mcp --http --host '0.0.0.0'+```++### ์ธ์ฆ {#authentication}++'stdio' ์ ์ก ๋ฐฉ์์์๋ ์๋ฒ๋ฅผ ์์ํ ํ๋ก๊ทธ๋จ๋ง ์๋ฒ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ํ์ง๋ง 'Streamable HTTP'๋ก ๋ฐ๊พธ๋ฉด ํฌํธ์ ์ ๊ทผํ ์ ์๋ ๋๊ตฌ๋ ๋ชจ๋ ๋๊ตฌ๋ฅผ ํธ์ถํ ์ ์์ต๋๋ค. ์๋ฒ๊ฐ ์คํ ์ค์ธ ์ปดํจํฐ์์ ์ด๋ค URL์ด๋ ๊ฐ์ ธ์ฌ ์๋ ์์ต๋๋ค. ์ด ๋๋ฌธ์ 'Streamable HTTP'์๋ ์ธ์ฆ์ด ํ์ํฉ๋๋ค. `--http`๋ง ์ ๋ฌํ๋ฉด ์๋ฒ๊ฐ ์์๋์ง ์๊ณ ํ ํฐ์ ์์ฒญํฉ๋๋ค.+```bash+scrapling-mcp --http --auth-token "$(openssl rand -hex 32)"+```+ํด๋ผ์ด์ธํธ๋ `Authorization` ํค๋์ ํ ํฐ์ ๋ณด๋ด์ผ ํฉ๋๋ค. ํ ํฐ์ด ์๋ ์์ฒญ์ `401`๋ก ๊ฑฐ๋ถ๋ฉ๋๋ค.+```json+{+ "mcpServers": {+ "ScraplingServer": {+ "url": "https://your-server.example.com/mcp",+ "headers": {+ "Authorization": "Bearer <your-token>"+ }+ }+ }+}+```+๋ช ๋ น์ค์ ํ ํฐ์ ๋ฃ์ผ๋ฉด ์ ธ ๊ธฐ๋ก๊ณผ ํ๋ก์ธ์ค ๋ชฉ๋ก์ ๋จ์ต๋๋ค. ๋ฐ๋ผ์ `SCRAPLING_MCP_AUTH_TOKEN` ํ๊ฒฝ ๋ณ์๋ฅผ ์ฌ์ฉํ์ธ์.+```bash+export SCRAPLING_MCP_AUTH_TOKEN="<your-token>"+scrapling-mcp --http+```+๊ธฐ๋ณธ ์ฃผ์ '127.0.0.1'์์ ๋ก์ปฌ ํ ์คํธ๋ฅผ ํ๋ ๊ฒฝ์ฐ์ฒ๋ผ ์ธ์ฆ ์๋ ์๋ฒ๊ฐ ํ์ํ๋ค๋ฉด `--no-auth`๋ก ๋ช ์ํด์ผ ํฉ๋๋ค.+```bash+scrapling-mcp --http --no-auth+```+`--no-auth`์ `--host '0.0.0.0'`์ ํจ๊ป ์ฌ์ฉํ๋ฉด ํฌํธ์ ์ ๊ทผํ ์ ์๋ ๋๊ตฌ๋ ๋ชจ๋ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ ๋ขฐํ ์ ์๋ ๋คํธ์ํฌ ๋ฐ์์๋ ๋ ์ต์ ์ ํจ๊ป ์ฌ์ฉํ์ง ๋ง์ธ์.++์๋ฒ๊ฐ ๊ณต์ฉ ์ฃผ์์์ ์ฐ๊ฒฐ์ ๋ฐ๋๋ค๋ฉด ํ์ฉํ ํธ์คํธ ์ด๋ฆ๋ ์ง์ ํ์ธ์. ๊ทธ๋ฌ๋ฉด DNS ๋ฆฌ๋ฐ์ธ๋ฉ ๊ณต๊ฒฉ์ ๋ง๋ ๋ณดํธ ๊ธฐ๋ฅ์ด ์ผ์ง๋๋ค. ์ด ๊ณต๊ฒฉ์ ๋ธ๋ผ์ฐ์ ๋ก ๋ฐฉ๋ฌธํ ์น์ฌ์ดํธ๊ฐ ์ฌ๋ฌ๋ถ์ ์๋ฒ์ ์ฐ๊ฒฐ์ ์๋ํ๋ ๋ฐฉ์์ ๋๋ค. ์ด ์ต์ ์ ์ฌ๋ฌ ๋ฒ ์ ๋ฌํ ์ ์์ต๋๋ค.+```bash+scrapling-mcp --http --allowed-host 'your-server.example.com:8000'+```++!!! note "์ฐธ๊ณ :"++ * ์ธ์ฆ์ 'Streamable HTTP' ์ ์ก ๋ฐฉ์์๋ง ์ ์ฉ๋ฉ๋๋ค. 'stdio'์์๋ ๋ฌด์๋๋ฉฐ, ์๋ฒ๊ฐ ์ด๋ฅผ ์๋ฆฌ๋ ๊ฒฝ๊ณ ๋ฅผ ๊ธฐ๋กํฉ๋๋ค.<br/>+ * ์ผ๋ฐ HTTP๋ ํ ํฐ์ ํ๋ฌธ์ผ๋ก ์ ์กํฉ๋๋ค. ์ธํฐ๋ท์ ๊ณต๊ฐํ๊ธฐ ์ ์ TLS ์ฐ๊ฒฐ์ ์ฒ๋ฆฌํ๋ ๋ฆฌ๋ฒ์ค ํ๋ก์ ๋ค์ ์๋ฒ๋ฅผ ๋์ธ์.<br/>+ * ํด๋ผ์ด์ธํธ๋ง๋ค ๋ค๋ฅธ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ฐ๋ ๋ฐฉ์์ด ์๋๋ผ ํ๋์ ๊ณต์ ํค๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋ชจ๋ ํด๋ผ์ด์ธํธ๊ฐ ๊ฐ์ ํ ํฐ์ ์ฐ๋ฉฐ, ํ ํฐ์ ๋ฐ๊พธ๋ ค๋ฉด ์๋ฒ๋ฅผ ๋ค์ ์์ํด์ผ ํฉ๋๋ค.<br/>+ * `--http --no-auth`๋ก ์์ํ๋ฉด ์ธ์ฆ์ด ๊บผ์ ธ ์๋ค๋ ๊ฒฝ๊ณ ๊ฐ ๊ธฐ๋ก๋ฉ๋๋ค.<br/>+ * `--auth-token`๊ณผ `--no-auth`๋ฅผ ํจ๊ป ์ ๋ฌํ๋ฉด ํ ํฐ์ ์ ์งํฉ๋๋ค. ์ธ์ฆ์ ์๋ฆฌ์ง ์๊ณ ํด์ ํ์ง ์์ต๋๋ค.++## ์์ {#examples}++MCP ์๋ฒ๋ฅผ ํ ์คํธํ ๋ ์ฌ์ฉํ ํ๋กฌํํธ๋ฅผ ๋ช ๊ฐ์ง ์๊ฐํฉ๋๋ค. ์ฌ๋ฌ๋ถ์ ๋ ์ฐฝ์์ ์ด๊ณ ๋ ์ข์ ํ๋กฌํํธ๋ฅผ ๋ง๋ค ์ ์์ ๊ฑฐ์์ :)++๊ฐ๋จํ ํ๋กฌํํธ๋ถํฐ ๋ณต์กํ ํ๋กฌํํธ๊น์ง ์ฐจ๋ก๋ก ์ดํด๋ด ๋๋ค. ์์ ์์๋ Claude Desktop์ ์ฌ์ฉํ์ง๋ง ๋ค๋ฅธ ํด๋ผ์ด์ธํธ์์๋ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์ธ ์ ์์ต๋๋ค.++1. **๊ธฐ๋ณธ ์น ์คํฌ๋ํ**++ ์นํ์ด์ง์ ์ฃผ์ ๋ด์ฉ์ Markdown์ผ๋ก ์ถ์ถํฉ๋๋ค.++ ```+ Scrape the main content from https://example.com and convert it to markdown format.+ ```++ Claude๋ `make_request`๋ก ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ ์ฝ๊ธฐ ์ฌ์ด ๋ด์ฉ์ ๋ฐํํ ์ ์์ต๋๋ค. HTTP ์์ฒญ์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ต๋ ์ธ ๋ฒ ์๋ํ๋ฉฐ, ๊ฐ ์๋ ์ฌ์ด์ 1์ด๋ฅผ ๊ธฐ๋ค๋ฆฝ๋๋ค. ํ์ด์ง์ JavaScript๊ฐ ํ์ํ๊ฑฐ๋ HTTP ์์ฒญ์ด ์ฐจ๋จ๋๋ฉด AI๊ฐ `browser_fetch_once`๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ ๋๊ตฌ ๋ชจ๋ ํธ์ถ ํ ์ฌ์ฉํ ๋ฆฌ์์ค๋ฅผ ์ ๋ฆฌํฉ๋๋ค.++ ๊ฐ์ ์์ฒญ์ ๋ ํจ์จ์ ์ผ๋ก ์ฐ๋ ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ํฉ๋๋ค.+ ```+ Use regular requests to scrape the main content from https://example.com and convert it to markdown format.+ ```+ ์ด๋ ๊ฒ ํ๋ฉด Claude๊ฐ ์ฌ์ฉํ ๋๊ตฌ๋ฅผ ์ถ์ธกํ ํ์๊ฐ ์์ต๋๋ค. ๋๋ก๋ ์ผ๋ฐ ์์ฒญ์ผ๋ก ์์ํ๊ณ , ๋๋ก๋ ๋๋ ทํ ์ด์ ์์ด ๋ธ๋ผ์ฐ์ ๊ฐ ๋ ์ ํฉํ๋ค๊ณ ํ๋จํ๊ธฐ๋ ํฉ๋๋ค. ์๊ฐ๊ณผ ๋น์ฉ์ ์ค์ด๊ณ ์ผ๊ด๋ ๊ฒฐ๊ณผ๋ฅผ ์ป์ผ๋ ค๋ฉด ์ฌ์ฉํ ๋๊ตฌ๋ฅผ Claude์ ์ง์ ์๋ ค์ฃผ๋ ๊ฒ์ด ์ข์ต๋๋ค.++2. **์ํ๋ ๋ฐ์ดํฐ๋ง ์ถ์ถํ๊ธฐ**++ CSS ์ ํ์๋ก ํน์ ์์๋ฅผ ์ถ์ถํฉ๋๋ค.++ ```+ Get all product titles from https://shop.example.com using the CSS selector '.product-title'. If the request fails, retry up to 5 times every 10 seconds.+ ```++ ์๋ฒ๋ ์ ํ์์ ๋ง๋ ์์๋ง ์ถ์ถํด ๊ตฌ์กฐํ๋ ๋ชฉ๋ก์ผ๋ก ๋ฐํํฉ๋๋ค. ์น์ฌ์ดํธ์ ์ฐ๊ฒฐ ๋ฌธ์ ๊ฐ ์์ ๋๋ฅผ ๋๋นํด ์ต๋ 5๋ฒ ์๋ํ๋๋ก ์ง์ ํ์ต๋๋ค. ๋๋ถ๋ถ์ ๊ฒฝ์ฐ์๋ ๊ธฐ๋ณธ ์ค์ ์ผ๋ก ์ถฉ๋ถํฉ๋๋ค.++3. **์ผํ๋ชฐ ๋ฐ์ดํฐ ์์งํ๊ธฐ**++ ์กฐ๊ธ ๋ ๋ณต์กํ ํ๋กฌํํธ์ ๋๋ค.+ ```+ Open a stealthy browser session and visit these e-commerce URLs one at a time:+ - https://shop1.com/product-a+ - https://shop2.com/product-b+ - https://shop3.com/product-c++ Get the product names, prices, and descriptions from each page. Close the session when done.+ ```++ Claude๋ ํ๋์ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ฌ์ฌ์ฉํ๊ณ ๊ฐ URL์ ๋ํด ์์๋๋ก `browser_fetch`๋ฅผ ํธ์ถํ ๋ค ์ถ์ถํ ๋ฐ์ดํฐ๋ฅผ ๋ถ์ํ ์ ์์ต๋๋ค.++4. **๋ ๋ณต์กํ ์์ ํ๋ฆ**++ ์ง๊ธ PlayStation ์คํ ์ด์ ์ฒซ ํ์ด์ง์ ์๋ ๋ชจ๋ ์ก์ ๊ฒ์์ ๊ฐ์ ธ์ค๊ณ ์ถ๋ค๋ฉด ๋ค์ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.+ ```+ Extract the URLs of all games on this page, then visit each game in order and return a list of all action games: https://store.playstation.com/en-us/pages/browse+ ```+ ์ผ๋ฐ ์์ฒญ์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์๋ค๋ฉด ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ์ง ์๋๋ก HTTP ์ธ์ ์ ์ฌ์ฌ์ฉํ๋ผ๊ณ AI์ ์๋ ค์ฃผ์ธ์.+ ```+ Open an HTTP session, extract the URLs of all games on this page, then fetch each game in order and return a list of all action games. Close the session when done: https://store.playstation.com/en-us/pages/browse+ ```+ CSS ์ ํ์๋ฅผ ์ธ ์ค ์๋ค๋ฉด AI๊ฐ ์ฝ๊ธฐ ์ ์ ๋ด์ฉ์ ๋ฒ์๋ฅผ ์ขํ ์๋ ์์ต๋๋ค.+ ```+ Use an HTTP session to extract the URLs of all games on the page below, then fetch each game in order and return a list of all action games.+ The selector for games in the first page is `[href*="/concept/"]` and the selector for the genre in each game page is `[data-qa="gameInfo#releaseInformation#genre-value"]`.+ Close the session when done.++ URL: https://store.playstation.com/en-us/pages/browse+ ```++5. **Cloudflare๋ก ๋ณดํธ๋ ์น์ฌ์ดํธ์์ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ**++ ๋์ ์น์ฌ์ดํธ์ Cloudflare ๋ณดํธ ๊ธฐ๋ฅ์ด ์๋ค๊ณ ์๊ฐ๋๋ฉด Claude๊ฐ ์ง์ ์์๋ด๋๋ก ๋์ง ๋ง๊ณ ๋ฏธ๋ฆฌ ์๋ ค์ฃผ์ธ์.+ ```+ What's the price of this product? Be cautious, as it utilizes Cloudflare's Turnstile protection. Make the browser visible while you work.++ https://ao.com/product/oo101uk-ninja-woodfire-outdoor-pizza-oven-brown-99357-685.aspx+ ```++6. **๊ธด ์์ ํ๋ฆ**++ ๋ค์๊ณผ ๊ฐ์ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.+ ```+ Extract all product URLs for the following category, then return the prices and details for the first 3 products.++ https://www.arnotts.ie/furniture/bedroom/bed-frames/+ ```+ ํ์ง๋ง ์๋์ฒ๋ผ ์ฐ๋ ํธ์ด ๋ ์ข์ต๋๋ค.+ ```+ Go to the following category URL and extract all product URLs using the CSS selector "a". Then, reuse the session to fetch the first 3 product pages in order and extract each productโs price and details. Close the session when done.++ Keep the output in markdown format to reduce irrelevant content.++ Category URL:+ https://www.arnotts.ie/furniture/bedroom/bed-frames/+ ```++7. **์ง์ ์ธ์ ์ฌ์ฉํ๊ธฐ**++ ๊ฐ์ ์ฌ์ดํธ์์ ์ฌ๋ฌ ํ์ด์ง๋ฅผ ์คํฌ๋ํํ ๋๋ ์ง์ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ฌ์ฉํ์ธ์. ์์ฒญ๋ง๋ค ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๋น์ฉ์ ์ค์ผ ์ ์์ต๋๋ค.+ ```+ Open a stealthy browser session, then use it to scrape the main details from the first 5 product pages on https://shop.example.com. Close the session when you're done.+ ```+ Claude๋ `browser_open`์ผ๋ก ๊ณ์ ์ฌ์ฉํ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ง๋ค๊ณ , ๊ฐ์ ์ธ์ ์์ ๊ฐ ์ํ ํ์ด์ง์ ๋ํด `browser_fetch`๋ฅผ ํธ์ถํ ๋ค ๋ง์ง๋ง์ `close_session`์ ํธ์ถํฉ๋๋ค. ํ์ด์ง๋ง๋ค ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๊ฒ๋ณด๋ค ํจ์ฌ ๋น ๋ฆ ๋๋ค.++ !!! danger "์ํ"++ ์ง์ ์ธ์ ์ ์ฌ์ฉํ ๋ค์๋ ๋ฐ๋์ ๋ซ์ผ์ธ์. ๋ซ์ง ์์ผ๋ฉด ์ธ์ ์ด ๊ณ์ ์ด๋ ค ์์ต๋๋ค!++8. **๊ธด ์์ ํ๋ฆ์์ ์ง์ ์ธ์ ์ฌ์ฉํ๊ธฐ**++ Claude๊ฐ ์ฌ๋ฌ ๋จ๊ณ๋ฅผ ์๊ฐํด์ผ ํ๋ ๊ธด ํ ์คํธ ์์ ์ ๋๋ค.++ ```+ Use Scrapling MCP to do the following in this order:++ 1. Open a stealthy browser session with headless mode off.+ 2. Go to this page and collect the number of stars: https://github.com/D4Vinci/Scrapling+ 3. From the README, get the URL that shows the number of downloads and go to it.+ 4. Get the number of downloads and the top 3 countries from the graph.+ 5. Prepare a report with the results.+ 6. Close the browser.+ ```++์ด๋ฐ ์์ผ๋ก ํ์ฉํ ์ ์์ต๋๋ค. ์ฌ๋ฌ๋ถ์ ์์ด๋์ด์ ๋ฐ๋ผ ๋ ๋ง์ ์์ ์ ํ ์ ์์ต๋๋ค.++## ๊ถ์ฅ ์ฌ์ฉ ๋ฐฉ๋ฒ {#best-practices}++๊ธฐ์ ์ ์ผ๋ก ์์๋๋ฉด ์ข์ ๋ช ๊ฐ์ง ํ์ ๋๋ค.++### 1. ์๋ง์ ๋๊ตฌ ์ ํํ๊ธฐ {#1-choose-the-right-tool}+- **`make_request`**: ๋จ์ผ ํ์ด์ง๋ API ํธ์ถ์ ์ฐ๋ ๋น ๋ฅธ HTTP ์์ฒญ+- **`browser_fetch_once`**: JavaScript๊ฐ ํ์ํ ๋จ์ผ ๋์ ํ์ด์ง๋ Cloudflare ๋ฑ์ผ๋ก ๋ณดํธ๋ ์ฌ์ดํธ+- **์ธ์ ๋๊ตฌ**: ์๋ก ๊ด๋ จ๋ ์์ฒญ, ๋ธ๋ผ์ฐ์ ์์ , ์คํฌ๋ฆฐ์ท, ๋คํธ์ํฌ ๊ธฐ๋ก++### 2. ์ฑ๋ฅ ๊ฐ์ ํ๊ธฐ {#2-optimize-performance}+- ์ธ์ ์ ์ฌ์ฌ์ฉํ๊ณ ๊ฐ URL์ ์์๋๋ก ๊ฐ์ ธ์ค์ธ์.+- ํ์ ์๋ ๋ฆฌ์์ค๋ ๋์ธ์.+- ์ ์ ํ ์ ํ ์๊ฐ์ ์ค์ ํ์ธ์.+- CSS ์ ํ์๋ก ํ์ํ ๋ด์ฉ๋ง ์ถ์ถํ์ธ์.++### 3. ๋์ ์ฝํ ์ธ ์ฒ๋ฆฌํ๊ธฐ {#3-handle-dynamic-content}+- SPA์๋ `network_idle`์ ์ฌ์ฉํ์ธ์.+- ํน์ ์์๋ฅผ ๊ธฐ๋ค๋ฆฌ๋ ค๋ฉด `wait_selector`๋ฅผ ์ค์ ํ์ธ์.+- ๋๋ฆฌ๊ฒ ๋ก๋๋๋ ์ฌ์ดํธ์์๋ ์ ํ ์๊ฐ์ ๋๋ฆฌ์ธ์.++### 4. ๋ฐ์ดํฐ ํ์ง {#4-data-quality}+- ํ์ด์ง์ ๋ณธ๋ฌธ์ ์ ํํ๊ณ ์ ๋ฆฌํ๋ ค๋ฉด `main_content_only=true`๋ฅผ ์ฌ์ฉํ์ธ์.+- ์ฉ๋์ ๋ง๋ `extraction_type`์ ์ ํํ์ธ์.++### 5. ํ๋กฌํํธ ์ธ์ ์ ๋ฐฉ์ง {#5-prompt-injection-protection}+MCP ์๋ฒ๋ `main_content_only`๊ฐ ์ผ์ ธ ์์ผ๋ฉด ์คํฌ๋ํํ ๋ด์ฉ์ ์๋์ผ๋ก ์ ๋ฆฌํฉ๋๋ค. ์ด ์ต์ ์ ๊ธฐ๋ณธ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ์ ์ฑ ์น์ฌ์ดํธ๊ฐ AI์ ์ปจํ ์คํธ์ ์ง์๋ฅผ ๋ฃ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ ์จ๊ฒจ์ง ๋ด์ฉ์ ์ ๊ฑฐํฉ๋๋ค.++- **์์๋ฅผ ์จ๊ธฐ๋ ์ธ๋ผ์ธ ์คํ์ผ**: `display:none`, `visibility:hidden`, ๋ถํฌ๋ช ๋, ๊ธ๊ผด ํฌ๊ธฐ, ๋์ด, ๋๋น, ์ต๋ ๋์ด, ์ต๋ ๋๋น์ ๊ฐ์ด 0์ธ ์คํ์ผ+- **์ ๊ทผ์ฑ ๋๊ตฌ์์ ์จ๊ธด ์์**: `aria-hidden="true"`+- **ํ ํ๋ฆฟ ํ๊ทธ์ ์จ๊ฒจ์ง ์ฌ๋กฏ**: `<template>`, `<slot hidden>` ์์+- **HTML ์ฃผ์**: `<!-- ... -->`+- **๋๋น๊ฐ 0์ธ ๋ฌธ์**: ๋๋น๊ฐ 0์ธ ๊ณต๋ฐฑ์ฒ๋ผ ๋์ ๋ณด์ด์ง ์๋ ์ ๋์ฝ๋ ๋ฌธ์++์ด ๋ณดํธ ๊ธฐ๋ฅ์ HTML, Markdown, ํ ์คํธ ์ถ์ถ์ ์๋์ผ๋ก ์ ์ฉ๋ฉ๋๋ค. ์ต๋ํ ๋ณดํธํ๋ ค๋ฉด ๊ธฐ๋ณธ๊ฐ์ธ `main_content_only=true`๋ฅผ ์ ์งํ์ธ์.++### 6. ์ธ์ ๊ด๋ฆฌํ๊ธฐ {#6-manage-sessions}+- ํ ๋ฒ๋ง ๊ฐ์ ธ์ฌ ๋๋ `make_request`๋ `browser_fetch_once`๋ฅผ ์ฌ์ฉํ์ธ์. ๋ ๋๊ตฌ๋ ๋ฆฌ์์ค๋ฅผ ์ง์ ์ ๋ฆฌํ๋ฉฐ, ๋ค์ ํธ์ถ์ ์ฌ์ฉํ ์ธ์ ์ ๋จ๊ธฐ์ง ์์ต๋๋ค.+- ์ฌ๋ฌ ํ์ด์ง๋ฅผ ์คํฌ๋ํํ ๋๋ `browser_open`์ผ๋ก ์ง์ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ๋ง๋ค๊ณ , ๊ฐ์ ์ธ์ ์์ ๊ฐ ํ์ด์ง์ ๋ํด `browser_fetch`๋ฅผ ํธ์ถํ์ธ์.+- ์ผ๋ฐ HTTP ์์ฒญ์ ์ฌ๋ฌ ๋ฒ ๋ณด๋ผ ๋๋ `open_request_session`์ ์ฌ์ฉํ๊ณ , ์์ฒญ๋ง๋ค `session_make_request`๋ฅผ ํธ์ถํ์ธ์. ๋ธ๋ผ์ฐ์ ์์ด๋ ํธ์ถ ์ฌ์ด์ ์ฟ ํค, ์ฐ๊ฒฐ, ๋ธ๋ผ์ฐ์ ์ง๋ฌธ(`impersonate`)์ ์ ์งํฉ๋๋ค.+- ์ธ์ ์ ์ด ๋ ์ง์ ํ ์ธ์ ์ค์ ์ ์ ์งํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์์๋ headless, locale, cookies, ์คํ ์ค ์ต์ ๋ฑ์ด ํด๋นํ๊ณ , ์์ฒญ ์ธ์ ์์๋ `impersonate`, `proxy`๊ฐ ํด๋นํฉ๋๋ค. timeout, wait_selector, network_idle, solve_cloudflare ๊ฐ์ ์์ฒญ๋ณ ์ต์ ์ `browser_fetch`/`session_make_request`๋ฅผ ํธ์ถํ ๋๋ง๋ค ์ ๋ฌํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ๊ฐ ๋๊ตฌ์ ์คํค๋ง์ ๋์ ์์ต๋๋ค.+- `browser_fetch`๋ ์ด๋ ค ์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์์ Cloudflare ๊ฒ์ฆ์ ํต๊ณผํ ์ ์์ต๋๋ค.+- ์์ ์ด ๋๋๋ฉด ํญ์ `close_session`์ผ๋ก ์ธ์ ์ ๋ซ์ ๋ฆฌ์์ค๋ฅผ ํด์ ํ์ธ์.+- `list_sessions`๋ก ์์ง ํ์ฑ ์ํ์ธ ์ธ์ ๊ณผ ์์ฑํ ๋ ์ฌ์ฉํ `settings`๋ฅผ ํ์ธํ์ธ์. ์ด ์ ๋ณด๋ AI ์์ด์ ํธ์ ๋ฐํ๋๋ฉฐ, CDP ์ธ์ ์์๋ ๋น์ด ์์ต๋๋ค.+- ์ธ์ ์ ์ฌ๋ ๋๊ตฌ์ ์ํ๋ `session_id`๋ฅผ ์ ๋ฌํ๋ฉด ๊ธฐ๋ณธ๊ฐ์ธ ์์์ 16์ง์ ๋์ ์๋ฏธ ์๋ ์ด๋ฆ(์: `"search"`, `"checkout"`)์ ๋ถ์ผ ์ ์์ต๋๋ค. ์ด๋ฏธ ์ฌ์ฉ ์ค์ธ ID๋ฅผ ์ง์ ํ๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฏ๋ก ์ด๋ฆ ์ถฉ๋์ ๋ฐ๋ก ์ ์ ์์ต๋๋ค.++### 7. ์คํฌ๋ฆฐ์ท ์ฐ๊ธฐ {#7-capturing-screenshots}++- `browser_screenshot`์ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์์ `browser_fetch`๋ก ์ด๋ฏธ ์ฐ ํ์ด์ง๋ฅผ ์บก์ฒํฉ๋๋ค. ํ์ด์ง๋ฅผ ๋ค์ ๋ก๋ํ์ง ์์ผ๋ฏ๋ก AI๊ฐ ์ ๋ ฅํ ํ๋, ์ด๋ฆฐ ๋ฉ๋ด ๋ฑ ์์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.+- ์ด๋ฏธ์ง๋ ์ค์ `ImageContent` ๋ธ๋ก์ผ๋ก ๋ฐํ๋๋ฏ๋ก ๋ชจ๋ธ์ด ํ์ด์ง๋ฅผ ์ง์ ๋ณผ ์ ์์ต๋๋ค.+- ํ์ฌ ๋ณด์ด๋ ํ๋ฉด์ด๋ ์๋์ชฝ์ ๋ณด์ด์ง ์๋ ๋ด์ฉ๊น์ง ํฌํจํ ์ ์ฒด ํ์ด์ง๋ฅผ ์บก์ฒํ ์ ์์ต๋๋ค.+- ํ๋, ์ฐจํธ, ์นด๋, ๊ฒฐ๊ณผ ํ๋๋ง ์บก์ฒํด ์ฃผ๋ณ ๋ด์ฉ์ ์ค์ผ ์ ์์ต๋๋ค. ์์๋ฅผ ์บก์ฒํ ๋๋ ๋์์ด ๋ณด์ด๋๋ก ์คํฌ๋กคํ ์ ์์ต๋๋ค.+- ์์ค ์๋ ์ด๋ฏธ์ง์๋ PNG๋ฅผ, ๋ ์์ ์ ์ก ํฌ๊ธฐ์๋ ํ์ง์ ์กฐ์ ํ ์ ์๋ JPEG๋ฅผ ์ ํํ์ธ์.+- AI๋ ์บก์ฒ ์ ์ `browser_actions`๋ก ์ฝํ ์ธ ๋ฅผ ๊ธฐ๋ค๋ฆฌ๊ฑฐ๋ ํ์ํ ์กฐ์์ ๋ง์น ์ ์์ต๋๋ค.++## ๋ฒ์ ์ฌํญ๊ณผ ์ค๋ฆฌ {#legal-and-ethical-considerations}++โ ๏ธ **์ค์ํ ์ง์นจ:**++- **robots.txt ํ์ธ**: `https://website.com/robots.txt`์์ ์คํฌ๋ํ ๊ท์น์ ํ์ธํ์ธ์.+- **์์ฒญ ์๋ ์ ํ ์ค์**: ๋๋ฌด ๋ง์ ์์ฒญ์ผ๋ก ์๋ฒ์ ๋ถ๋ด์ ์ฃผ์ง ๋ง์ธ์.+- **์ด์ฉ ์ฝ๊ด**: ์น์ฌ์ดํธ์ ์ฝ๊ด์ ์ฝ๊ณ ์ค์ํ์ธ์.+- **์ ์๊ถ**: ์ง์์ฌ์ฐ๊ถ์ ์กด์คํ์ธ์.+- **๊ฐ์ธ์ ๋ณด**: ๊ฐ์ธ์ ๋ณด ๋ณดํธ๋ฒ์ ์ฃผ์ํ์ธ์.+- **์์ ์ ์ด์ฉ**: ์ฌ์ ๋ชฉ์ ์ผ๋ก ์ด์ฉํ ๊ถํ์ด ์๋์ง ํ์ธํ์ธ์.++---++*Scrapling ํ์ด โค๏ธ๋ฅผ ๋ด์ ๋ง๋ค์์ต๋๋ค. ์ฆ๊ฒ๊ฒ ์คํฌ๋ํํ์ธ์!*diff --git a/docs/locales/ko/api-reference/custom-types.md b/docs/locales/ko/api-reference/custom-types.mdnew file mode 100644index 0000000..444a8be--- /dev/null+++ b/docs/locales/ko/api-reference/custom-types.md@@ -0,0 +1,26 @@+---+title: "TextHandler์ AttributesHandler API ์ฐธ๊ณ ๋ฌธ์"+description: "ํ ์คํธ, ํ ์คํธ ๋ชฉ๋ก, ์์ฑ์ ๋ค๋ฃจ๋ Scrapling์ ์๋ฃํ์ ํ์ธํ์ธ์. ์ ๊ท์, JSON ๋ณํ, ๊ฐ ๊ฒ์์ ์ง์ํฉ๋๋ค."+---++# ์ฌ์ฉ์ ์ ์ ์๋ฃํ {#custom-types-api-reference}++Scrapling์ ์ฌ์ฉ์ ์ ์ ์๋ฃํ์ ์๋ ์ธ์, ์์ฑ, ๋ฉ์๋๋ฅผ ์ค๋ช ํฉ๋๋ค.++๋ค์์ฒ๋ผ ์ง์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค:++```python+from scrapling.core.custom_types import TextHandler, TextHandlers, AttributesHandler+```++## ::: scrapling.core.custom_types.TextHandler+ handler: python+ :docstring:++## ::: scrapling.core.custom_types.TextHandlers+ handler: python+ :docstring:++## ::: scrapling.core.custom_types.AttributesHandler+ handler: python+ :docstring:diff --git a/docs/locales/ko/api-reference/fetchers.md b/docs/locales/ko/api-reference/fetchers.mdnew file mode 100644index 0000000..cd9b227--- /dev/null+++ b/docs/locales/ko/api-reference/fetchers.md@@ -0,0 +1,48 @@+---+title: "HTTPยท๋ธ๋ผ์ฐ์ Fetcher API ์ฐธ๊ณ ๋ฌธ์"+description: "Fetcher, AsyncFetcher, StealthyFetcher์ ์ธ์ ์ API๋ฅผ ํ์ธํ์ธ์. ์์ฒญ ์ต์ , ๋ธ๋ผ์ฐ์ ์ค์ , ๋ฐํ ์๋ฃํ์ ์ค๋ช ํฉ๋๋ค."+---++# Fetcher ํด๋์ค {#fetchers-classes}++๋ชจ๋ Fetcher ํด๋์ค์ ์ธ์, ์์ฑ, ๋ฉ์๋๋ฅผ ์ค๋ช ํฉ๋๋ค.++๋ค์์ฒ๋ผ ์ง์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค:++```python+from scrapling.fetchers import (+ Fetcher, AsyncFetcher, StealthyFetcher,+ FetcherSession, AsyncStealthySession, StealthySession+)+```++## ::: scrapling.fetchers.Fetcher+ handler: python+ :docstring:++## ::: scrapling.fetchers.AsyncFetcher+ handler: python+ :docstring:++## ::: scrapling.fetchers.StealthyFetcher+ handler: python+ :docstring:+++## ์ธ์ ํด๋์ค {#session-classes}++### HTTP ์ธ์ {#http-sessions}++## ::: scrapling.fetchers.FetcherSession+ handler: python+ :docstring:++### ์คํ ์ค ์ธ์ {#stealth-sessions}++## ::: scrapling.fetchers.StealthySession+ handler: python+ :docstring:++## ::: scrapling.fetchers.AsyncStealthySession+ handler: python+ :docstring:diff --git a/docs/locales/ko/api-reference/mcp-server.md b/docs/locales/ko/api-reference/mcp-server.mdnew file mode 100644index 0000000..17bce90--- /dev/null+++ b/docs/locales/ko/api-reference/mcp-server.md@@ -0,0 +1,96 @@+---+title: "Scrapling MCP ์๋ฒ API ์ฐธ๊ณ ๋ฌธ์"+description: "HTTP์ ๋ธ๋ผ์ฐ์ ๋ก ๋ฐ์ดํฐ๋ฅผ ์์งํ๋ MCP ๋๊ตฌ, ์์ฒญยท์๋ต ๋ชจ๋ธ, ์ธ์ ์์ ์ ํ์ธํ์ธ์."+---++# MCP ์๋ฒ API ์ฐธ๊ณ ๋ฌธ์ {#mcp-server-api-reference}++**Scrapling MCP ์๋ฒ**๋ Model Context Protocol(MCP)์ ํตํด ์น ์คํฌ๋ํ๊ณผ ๋ธ๋ผ์ฐ์ ์กฐ์์ ์ํ 16๊ฐ ๋๊ตฌ๋ฅผ ์ ๊ณตํฉ๋๋ค. AI ์ฑ๋ด์ด๋ ์์ด์ ํธ์ ์ฐ๊ฒฐํ๋ฉด ๋ํ๋ก ๋ฐ์ดํฐ๋ฅผ ์์งํ ์ ์์ผ๋ฉฐ, ๋ด ์ฐจ๋จ ์ฐํ ๊ธฐ๋ฅ๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.++๋ค์ ๋ช ๋ น์ผ๋ก MCP ์๋ฒ๋ฅผ ์์ํฉ๋๋ค:++```bash+scrapling mcp+```++์๋ฒ ํด๋์ค๋ฅผ ์ง์ ๊ฐ์ ธ์ฌ ์๋ ์์ต๋๋ค:++```python+from scrapling.core.ai import ScraplingMCPServer++server = ScraplingMCPServer()+server.serve(http=False, host="127.0.0.1", port=8000)+```++์ง์ ์ค๋นํ Chromium ํธํ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด `executable_path`๋ก ์คํ ํ์ผ์ ์ง์ ํ์ธ์:++```python+server = ScraplingMCPServer(executable_path="/path/to/chromium")+```++## ์๋ต ๋ชจ๋ธ {#response-model}++ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ์ HTTP ์์ฒญ ๋๊ตฌ๋ ์๋ ํ์์ผ๋ก ํธ์ถ๋น ํ๋์ ์๋ต์ ๋ฐํํฉ๋๋ค. ์ธ์ ๊ด๋ฆฌ ๋๊ตฌ๋ ๋ค์ ๋์ค๋ ๋ชจ๋ธ์ ์ฌ์ฉํฉ๋๋ค. `browser_screenshot`์ ํ์ด์ง๋ ์์์ ์ด๋ฏธ์ง์ ํ์ฌ URL์ ์ด๋ฏธ์ง ๋ธ๋ก๊ณผ ํ ์คํธ ๋ธ๋ก์ผ๋ก ๋ฐํํฉ๋๋ค. `browser_extract`์ `browser_actions`๋ ์ผ๋ฐ ํ ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค. ๋ ๋คํธ์ํฌ ๋๊ตฌ๋ ์๋ ๋ชจ๋ธ์ ๋ฐ๋ฅธ ๊ตฌ์กฐํ๋ JSON์ ๋ฐํํฉ๋๋ค. `browser_evaluate`๋ ๊ฒฐ๊ณผ๋ฅผ JSON์ผ๋ก ๋ง๋ค์ด ํ ์คํธ ๋ธ๋ก์ ๋ด์ต๋๋ค.++## ::: scrapling.core.ai.server.ResponseModel+ handler: python+ :docstring:++## ๋คํธ์ํฌ ์์ฒญ ๋ชจ๋ธ {#network-request-models}++`browser_network_requests`๋ `requests`, `next_cursor`, `has_more`, `dropped_count`๊ฐ ์๋ `NetworkRequestsModel`์ ๋ฐํํฉ๋๋ค. ๊ฐ `NetworkRequestInfo`์๋ `id`, `url`, `method`, `resource_type`, `status`๊ฐ ์์ต๋๋ค. ๋ค์ ๊ฒฐ๊ณผ๋ฅผ ์ฝ์ผ๋ ค๋ฉด `next_cursor`๋ฅผ `after_id`๋ก ์ ๋ฌํ์ธ์. `has_more`๋ ํ์ฌ ๊ธฐ๋ก์ ์กฐ๊ฑด๊ณผ ์ผ์นํ๋ ๊ฒฐ๊ณผ๊ฐ ๋ ์๋์ง ๋ํ๋ ๋๋ค.++`browser_network_request`๋ `request_id`, `part`, `data`, `note`๊ฐ ์๋ `NetworkRequestModel`์ ๋ฐํํฉ๋๋ค. ์์ฝ๊ณผ ํค๋๋ ๊ฐ์ฒด์ ๋๋ค. ์ ์ฅ๋ ์ ์ฒด ๋ณธ๋ฌธ์ JSON ์๋ต์ด์ด๋ ๋ฌธ์์ด๋ก ๋ฐํํฉ๋๋ค. `note`๋ ๋ณธ๋ฌธ์ด ์๊ฑฐ๋ ํค๋๊ฐ ์ผ๋ถ๋ง ์๋ ์ด์ ๋ฅผ ์ค๋ช ํฉ๋๋ค.++## ::: scrapling.core.ai._network_formatting.NetworkRequestInfo+ handler: python+ :docstring:++## ::: scrapling.core.ai.server.NetworkRequestsModel+ handler: python+ :docstring:++## ::: scrapling.core.ai._network_formatting.NetworkRequestModel+ handler: python+ :docstring:++## ์ธ์ ๋ชจ๋ธ {#session-models}++์ธ์ ๊ด๋ฆฌ์ ์ฌ์ฉํ๋ ๋ชจ๋ธ ํด๋์ค์ ๋๋ค:++## ::: scrapling.core.ai.server.SessionInfo+ handler: python+ :docstring:++## ::: scrapling.core.ai.server.SessionCreatedModel+ handler: python+ :docstring:++## ::: scrapling.core.ai.server.SessionClosedModel+ handler: python+ :docstring:++## MCP ์๋ฒ ํด๋์ค {#mcp-server-class}++MCP ์๋ฒ์ ์ฃผ์ ํด๋์ค๋ ๋ค์ ๋๊ตฌ๋ฅผ ์ ๊ณตํฉ๋๋ค:++- **`make_request`**: ๋ธ๋ผ์ฐ์ ๋ฅผ ํ๋ด ๋ธ HTTP ์์ฒญ์ผ๋ก URL ํ๋๋ฅผ ๊ฐ์ ธ์จ ๋ค ํด๋ผ์ด์ธํธ๋ฅผ ์๋์ผ๋ก ๋ซ์ต๋๋ค. GET, POST, PUT, DELETE๋ฅผ ์ง์ํฉ๋๋ค.+- **`browser_fetch_once`**: ์คํ ์ค ๋ธ๋ผ์ฐ์ ๋ก URL ํ๋๋ฅผ ๊ฐ์ ธ์ค๊ณ JavaScript ์คํ๊ณผ Cloudflare ์ฒ๋ฆฌ๋ฅผ ๋ง์น ๋ค ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ซ์ต๋๋ค. ๋์ค์ ์กฐ์ํ๊ฑฐ๋ ๋คํธ์ํฌ ๊ธฐ๋ก์ ์ฝ์ผ๋ ค๋ฉด ์ง์ ์ธ์ ์ ์ฌ์ฉํ์ธ์.++- **`browser_extract`**: ์๋ก๊ณ ์นจ ์์ด ํ์ฌ ํ์ด์ง๋ ์์๋ฅผ AI์ฉ ๊ตฌ์กฐ ์ค๋ ์ท, HTML, Markdown, ํ ์คํธ๋ก ์ฝ์ต๋๋ค. ํผ ์ ๋ ฅ๊ณผ ํ์ด์ง ์กฐ์ ๊ฒฐ๊ณผ๊ฐ ์ ์ง๋ฉ๋๋ค. ์ค๋ ์ท์๋ ์์์ ์ญํ , ์ด๋ฆ, ์ฐธ์กฐ, ์์น, ํฌ๊ธฐ๊ฐ ๋ค์ด ์์ต๋๋ค. ์ ๊ท์ ๊ฒ์์ ์ผ์นํ๋ ์ค๊ณผ ์ฃผ๋ณ ๋ด์ฉ, ๋ถ๋ชจ ๋ ธ๋๋ฅผ ๋ฐํํฉ๋๋ค.+- **`browser_actions`**: ๋ง์ฐ์ค ์ด๋, ๊ฐ๋ฆฌํค๊ธฐ, ํด๋ฆญ, ์คํฌ๋กค, ํ๋ ์ ๋ ฅ, ๋จ์ถํค, ๋ํ ์์ ์๋ต, ๋๊ธฐ๋ฅผ ํ ๋ฒ์ ํธ์ถ๋ก ์ด์ด์ ์คํํฉ๋๋ค. ์๋ฆผ๊ณผ ํ์ธ ์ฐฝ์ ์๋ฝํ๊ฑฐ๋ ๋ซ๊ณ ์ ๋ ฅ ์ฐฝ์ ๊ธ์ ์ธ ์ ์์ต๋๋ค. ๊ฒ์์ด ์ ๋ ฅ, ์ ์ถ, ๊ฒฐ๊ณผ ๋๊ธฐ, ๊ฒฐ๊ณผ ์ด๊ธฐ๋ฅผ ๊ฐ๊ฐ ํธ์ถํ ํ์๊ฐ ์์ต๋๋ค.++ ์ด๋๊ณผ ํด๋ฆญ์ ๋์์ ์ ํ์, ์ค๋ ์ท ์ฐธ์กฐ, ์ขํ๋ก ์ง์ ํฉ๋๋ค. ์์๊ฐ ์ค๋น๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฐ ๋ค ํ๋ฉด์ ๋ณด์ด๋๋ก ์คํฌ๋กคํฉ๋๋ค. ์ฌ๋ฌ ๋จ๊ณ์ ์ด๋, ์ผ์ชฝยท์ค๋ฅธ์ชฝยท๊ฐ์ด๋ฐ ํด๋ฆญ, ๋๋ธ ํด๋ฆญ, ์ค์ฒฉ ์์ญ ์คํฌ๋กค์ ์ง์ํฉ๋๋ค.++ ์ ํ์๋ ์ค๋ ์ท ์ฐธ์กฐ๋ก ํ์ด์ง์ ํ๋๋ฅผ ์ฐพ์ต๋๋ค. ํ ์คํธ ์ ๋ ฅ, ์ฒดํฌ๋ฐ์ค ์ ํ๊ณผ ํด์ , ๋ผ๋์ค ๋ฒํผ ์ ํ, ๊ธฐ๋ณธ ๋๋กญ๋ค์ด์ ๋จ์ผยท๋ค์ค ํญ๋ชฉ ์ ํ์ ํ ์ ์์ต๋๋ค. ๋๋กญ๋ค์ด ํญ๋ชฉ์ ํ์๋ ์ด๋ฆ์ผ๋ก ๊ณ ๋ฆ ๋๋ค. ํ ์คํธ๋ฅผ ๋ฐ๊พธ๊ฑฐ๋ ์ง์ฐ๊ณ , ์ปค์ ์์น์ ์ด์ด ์ธ ์๋ ์์ต๋๋ค. ๋จ์ถํค๋ ํ์ฌ ํฌ์ปค์ค์ ์ ์ฉ๋ฉ๋๋ค. ๋๋ฆฐ ๋ชจ๋๋ ๊ธ์์ ์์ ์ฌ์ด์ ๋ฌด์์ ๋๊ธฐ ์๊ฐ์ ๋ฃ์ต๋๋ค.++ ์ ํ์๋ ์ค๋ ์ท ์ฐธ์กฐ๋ก ์ฝํ ์ธ ๋ ๋ก๋ฉ ํ์๊ฐ ์ง์ ํ ์ํ๊ฐ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆด ์ ์์ต๋๋ค. ํ์ด์ง ๋ก๋ ์ด๋ฒคํธ, ๋คํธ์ํฌ ํ๋์ด ๋ฉ์ถ ๋๊น์ง์ ๋๊ธฐ, ์ผ์ ์๊ฐ ๋๊ธฐ๋ ์ง์ํฉ๋๋ค.++- **`browser_evaluate`**: ํ์ฌ ํ์ด์ง์์ JavaScript๋ฅผ ์คํํด ์ํ๋ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๊ณ , ๊ณ์ฐํ๊ณ , ์ฑ ์ํ๋ฅผ ์ฝ๊ฑฐ๋ ํ์ด์ง ๋ด์ฉ์ ๋ฐ๊ฟ๋๋ค. ๋น๋๊ธฐ ์คํฌ๋ฆฝํธ๋ฅผ ์ง์ํ๋ฉฐ ๊ฒฐ๊ณผ๋ JSON์ผ๋ก ๋ฐํํฉ๋๋ค.+- **`browser_network_requests`**: ํญ, ํ์ด์ง ์ด๋, ์กฐ์ ์ ๋ฐ์์ ์๋ฃ๋ ๋ธ๋ผ์ฐ์ ์์ฒญ์ ๊ฒ์ํฉ๋๋ค. API ํธ์ถ, HTTP ์ค๋ฅ, ์ ์ฅ๋ ๋ฆฌ๋๋ ์ ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฒฐ๊ณผ๋ฅผ ์ค์ด๊ธฐ ์ํด ์ ์ ๋ฆฌ์์ค๋ ๊ธฐ๋ณธ์ผ๋ก ์จ๊น๋๋ค. ์คํจํ๊ฑฐ๋ ๋๋์ง ์์ ์์ฒญ์ ์ ์ธํฉ๋๋ค. ํ์ด์ง ๋จ์๋ก ๊ตฌ์กฐํ๋ ์์ฒญ ์ ๋ณด๋ฅผ ๋ฐํํฉ๋๋ค.+- **`browser_network_request`**: ์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ ์ ์ฅ๋ ์์ฒญ์ ์์ฝ, ํค๋, ์ ์ก ๋ฐ์ดํฐ, ํ ์คํธ ์๋ต ๋ณธ๋ฌธ์ ๊ตฌ์กฐํ๋ JSON์ผ๋ก ์ฝ์ต๋๋ค. ์ ์ฅ๋ ๋ณธ๋ฌธ์ ํฌํจํด ์ ํํ ๋ถ๋ถ์ ์ ๋ถ ๋ฐํํฉ๋๋ค. HTTP 4xxยท5xx ์๋ต์ ํฌํจํ ์ ์ฅ ๊ธฐ๋ก์ ํ์ด์ง๊ฐ ๋ฐ๋์ด๋ ๋จ์ ์์ต๋๋ค. ๊ธฐ๋ก์ ์ ์ฅ์ด ๋๋์ผ ๋ํ๋ฉ๋๋ค. ๊ธฐ๋ก ์ฝ๊ธฐ๋ ์ธ์ ์ข ๋ฃ๋ ์ ์ฅ ์๋ฃ๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์์ผ๋ฏ๋ก ํ์ด์ง ์ด๋์ด๋ ์ข ๋ฃ ์ ์งํ ์ค์ธ ๊ธฐ๋ก์ด ๋น ์ง ์ ์์ต๋๋ค. ๋ฐ์ดํธ๋ Playwright์์ ๊ฐ์ ธ์ค๋ฏ๋ก ์๋ฒ์ ์๋ณธ ๋ฐ์ดํธ์ ๋ค๋ฅผ ์ ์์ต๋๋ค. ์ ์ฅ๋ ๋ฐ์ดํธ๊ฐ ์ฌ๋ฐ๋ฅธ UTF-8์ด๋ฉด Playwright์ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋์ฝ๋ฉํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ์๋ต์ ์ง์ ๋ ๋ฌธ์ ์ธ์ฝ๋ฉ์ ์ฌ์ฉํฉ๋๋ค. ์ง์ํ๋ ํ ์คํธ `Content-Type`์ ๋ณธ๋ฌธ๋ง ์ฝ๊ณ ์ ์ฅํฉ๋๋ค. ๋ฐ์ด๋๋ฆฌ, ์ ์ ์๋ ์ ํ, ์ ํ์ด ์๋ ์๋ต์ ๋ณธ๋ฌธ์ ์ฝ์ง ์๊ณ ๋ฉํ๋ฐ์ดํฐ์ ํค๋๋ง ์ ์ฅํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์ ํ์ด์ง ๋ก๋๋ ๋ฌ๋ผ์ง์ง ์์ต๋๋ค. ๊ธฐ๋ก์ ํฌ๊ธฐ๋ ์ ํ๋๋ฉฐ, ๋ณธ๋ฌธ์ด ํ ์คํธ๊ฐ ์๋๊ฑฐ๋ ๋๋ฌด ํฌ๊ฑฐ๋ ์ฝ์ ์ ์๋ ๊ฒฝ์ฐ ์ ํ์ ๋ฉ๋ชจ๋ก ์ด์ ๋ฅผ ์ค๋ช ํฉ๋๋ค. ํ์ํ ์ ๋ณด๋ MCP ์ธ์ ์ ๋ซ๊ธฐ ์ ์ ์ฝ์ผ์ธ์.+- **`browser_fetch`**: ์ด๋ฆฐ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์์ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ HTML, Markdown, ํ ์คํธ, ๊ตฌ์กฐ ์ค๋ ์ท์ ์ถ์ถํฉ๋๋ค. ์ค๋ ์ท์ ํ์ด์ง ์ ์ฒด๋ ์ ํํ ์์๋ฅผ ๋์์ผ๋ก ํ๋ฉฐ, ๋์ค์ ์กฐ์ํ ์ ์๋๋ก ์์ ์ฐธ์กฐ, ์์น, ํฌ๊ธฐ๋ฅผ ํฌํจํฉ๋๋ค.++## ::: scrapling.core.ai.server.ScraplingMCPServer+ handler: python+ :docstring:diff --git a/docs/locales/ko/api-reference/proxy-rotation.md b/docs/locales/ko/api-reference/proxy-rotation.mdnew file mode 100644index 0000000..8125cd7--- /dev/null+++ b/docs/locales/ko/api-reference/proxy-rotation.md@@ -0,0 +1,18 @@+---+title: "ProxyRotator API ์ฐธ๊ณ ๋ฌธ์"+description: "HTTPยท๋ธ๋ผ์ฐ์ ์ธ์ ์์ ProxyRotator๋ก ํ๋ก์๋ฅผ ์ ํํ๊ณ ๊ต์ฒดํ๋ ๋ฐฉ๋ฒ์ ํ์ธํ์ธ์."+---++# ํ๋ก์ ๊ต์ฒด {#proxy-rotation}++`ProxyRotator`๋ ๋ชจ๋ Fetcher์ ์ธ์ ์์ ํ๋ก์๋ฅผ ๊ต์ฒดํฉ๋๋ค. ์ฌ๋ฌ ์ค๋ ๋์์ ์์ ํ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค.++๋ค์์ฒ๋ผ ์ง์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค:++```python+from scrapling.fetchers import ProxyRotator+```++## ::: scrapling.engines.toolbelt.proxy_rotation.ProxyRotator+ handler: python+ :docstring:diff --git a/docs/locales/ko/api-reference/response.md b/docs/locales/ko/api-reference/response.mdnew file mode 100644index 0000000..3e26b8b--- /dev/null+++ b/docs/locales/ko/api-reference/response.md@@ -0,0 +1,18 @@+---+title: "Response API ์ฐธ๊ณ ๋ฌธ์"+description: "Response์ ์ํ, ํค๋, ๋ณธ๋ฌธ, ๋ฉํ๋ฐ์ดํฐ, Markdown ๋ณํ, follow๋ฅผ ํ์ธํ์ธ์. Selector์์ ์์ํ ์ถ์ถ ๋ฉ์๋๋ ์ฌ์ฉํ ์ ์์ต๋๋ค."+---++# Response ํด๋์ค {#response-class}++`Response`๋ ๋ชจ๋ Fetcher๊ฐ ๋ฐํํ๋ HTTP ์๋ต์ ๋ํ๋ ๋๋ค. ์ํ, ํค๋, ๋ณธ๋ฌธ, ์ฟ ํค๋ฅผ ์ฝ์ ์ ์๊ณ `Selector`์์ ์์ํ ํ์ฑ ๊ธฐ๋ฅ๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.++`Response` ํด๋์ค๋ ๋ค์์ฒ๋ผ ๊ฐ์ ธ์ต๋๋ค:++```python+from scrapling.engines.toolbelt.custom import Response+```++## ::: scrapling.engines.toolbelt.custom.Response+ handler: python+ :docstring:diff --git a/docs/locales/ko/api-reference/selector.md b/docs/locales/ko/api-reference/selector.mdnew file mode 100644index 0000000..4dadb47--- /dev/null+++ b/docs/locales/ko/api-reference/selector.md@@ -0,0 +1,24 @@+---+title: "Selector์ Selectors API ์ฐธ๊ณ ๋ฌธ์"+description: "Selector์ Selectors์ HTML ํ์ฑ, ์์ ์ ํ, ๋ฐ์ดํฐ ์ถ์ถ, ํ์, ์ ์ํ ๊ฒ์ ๋ฉ์๋๋ฅผ ํ์ธํ์ธ์."+---++# Selector ํด๋์ค {#selector-class}++`Selector`๋ HTML์ ํ์ฑํ๊ณ ์์๋ฅผ ์ ํํ๋ Scrapling์ ํต์ฌ ํด๋์ค์ ๋๋ค.++`Selector`์ ๋ชจ๋ ์ธ์, ์์ฑ, ๋ฉ์๋๋ฅผ ์ค๋ช ํฉ๋๋ค.++`Selector`๋ `scrapling`์์ ์ง์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค:++```python+from scrapling.parser import Selector+```++## ::: scrapling.parser.Selector+ handler: python+ :docstring:++## ::: scrapling.parser.Selectors+ handler: python+ :docstring:diff --git a/docs/locales/ko/api-reference/spiders.md b/docs/locales/ko/api-reference/spiders.mdnew file mode 100644index 0000000..ca61921--- /dev/null+++ b/docs/locales/ko/api-reference/spiders.md@@ -0,0 +1,42 @@+---+title: "Spider, ์์ฒญ, ๊ฒฐ๊ณผ API ์ฐธ๊ณ ๋ฌธ์"+description: "์คํ์ด๋ ํ , ์์ฒญ, ์ธ์ , ํฌ๋กค๋ง ํต๊ณ, ๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ ๋ฐฉ๋ฒ์ ํ์ธํ์ธ์."+---++# Spider ํด๋์ค {#spider-classes}++์คํ์ด๋ ํ๋ ์์ํฌ์ ํฌํจ๋ ํด๋์ค์ ์ธ์, ์์ฑ, ๋ฉ์๋๋ฅผ ์ค๋ช ํฉ๋๋ค.++๋ค์์ฒ๋ผ ์ง์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค:++```python+from scrapling.spiders import Spider, Request, CrawlResult, SessionManager, Response+```++## ::: scrapling.spiders.Spider+ handler: python+ :docstring:++## ::: scrapling.spiders.Request+ handler: python+ :docstring:++## ๊ฒฐ๊ณผ ํด๋์ค {#result-classes}++## ::: scrapling.spiders.result.CrawlResult+ handler: python+ :docstring:++## ::: scrapling.spiders.result.CrawlStats+ handler: python+ :docstring:++## ::: scrapling.spiders.result.ItemList+ handler: python+ :docstring:++## ์ธ์ ๊ด๋ฆฌ {#session-management}++## ::: scrapling.spiders.session.SessionManager+ handler: python+ :docstring:diff --git a/docs/locales/ko/assets b/docs/locales/ko/assetsnew file mode 120000index 0000000..41aef43--- /dev/null+++ b/docs/locales/ko/assets@@ -0,0 +1 @@+../../assets\ No newline at end of filediff --git a/docs/locales/ko/benchmarks.md b/docs/locales/ko/benchmarks.mdnew file mode 100644index 0000000..010826d--- /dev/null+++ b/docs/locales/ko/benchmarks.md@@ -0,0 +1,33 @@+---+title: "Python HTML ํ์ ์ฑ๋ฅ ๋น๊ต: Scrapling๊ณผ ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ"+description: "HTML ํ์ฑ, ํ ์คํธ ์ถ์ถ, ๋น์ทํ ์์ ์ฐพ๊ธฐ์์ Scrapling๊ณผ ๋ค๋ฅธ Python ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ฑ๋ฅ์ ๋น๊ตํฉ๋๋ค."+---++# ์ฑ๋ฅ ํ ์คํธ {#performance-benchmarks}++Scrapling์ ๊ฐ๋ ฅํ ๋ฟ ์๋๋ผ ๋งค์ฐ ๋น ๋ฆ ๋๋ค. ๋ค์ ํ ์คํธ๋ Scrapling ํ์์ ๋๋ฆฌ ์ฐ์ด๋ ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋น๊ตํฉ๋๋ค.++### ํ ์คํธ ์ถ์ถ ์๋: ์ค์ฒฉ ์์ 5,000๊ฐ {#text-extraction-speed-test-5000-nested-elements}++| # | ๋ผ์ด๋ธ๋ฌ๋ฆฌ | ์๊ฐ(ms) | Scrapling ๋๋น |+|---|:-----------------:|:---------:|:------------:|+| 1 | Scrapling | 1.99 | 1.0x |+| 2 | Parsel/Scrapy | 2.06 | 1.035 |+| 3 | Lxml ๋จ๋ | 2.56 | 1.286 |+| 4 | PyQuery | 23.98 | ~12x |+| 5 | Selectolax | 197.02 | ~99x |+| 6 | MechanicalSoup | 1545.15 | ~776.5x |+| 7 | BS4 + Lxml | 1562.1 | ~785.0x |+| 8 | BS4 + html5lib | 3412.73 | ~1714.9x |+++### ๋น์ทํ ์์ ์ฐพ๊ธฐ์ ํ ์คํธ ๊ฒ์ {#element-similarity-text-search-performance}++Scrapling์ ์ ์ํ ์์ ๊ฒ์์ ๋ค๋ฅธ ๋ฐฉ๋ฒ๋ณด๋ค ํจ์ฌ ๋น ๋ฆ ๋๋ค:++| ๋ผ์ด๋ธ๋ฌ๋ฆฌ | ์๊ฐ(ms) | Scrapling ๋๋น |+|-------------|:---------:|:------------:|+| Scrapling | 2.3 | 1.0x |+| AutoScraper | 12.58 | 5.47x |++> ๊ฐ ๊ฒฐ๊ณผ๋ ์๊ฐ์ ์ธก์ ํ 100ํ ์คํ์ ํ๊ท ์ ๋๋ค. ์ธก์ ๋ฐฉ๋ฒ์ [benchmarks.py](https://github.com/D4Vinci/Scrapling/blob/main/benchmarks.py)๋ฅผ ํ์ธํ์ธ์.diff --git a/docs/locales/ko/cli/extract-commands.md b/docs/locales/ko/cli/extract-commands.mdnew file mode 100644index 0000000..3d45e76--- /dev/null+++ b/docs/locales/ko/cli/extract-commands.md@@ -0,0 +1,326 @@+---+title: "CLI๋ก ์นํ์ด์ง๋ฅผ Markdown, HTML, ํ ์คํธ๋ก ์ ์ฅํ๊ธฐ"+description: "scrapling extract๋ก HTTP๋ ๋ธ๋ผ์ฐ์ ์์ ๊ฐ์ ธ์จ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ์ธ์. CSS๋ก ๋ด์ฉ์ ๊ฑธ๋ฌ ๋ด๊ณ , ์์ฒญ ์ต์ ๊ณผ ์ถ๋ ฅ ํ์์ ์ ํํ ์ ์์ต๋๋ค."+---++# Scrapling ์ถ์ถ ๋ช ๋ น ์๋ด {#scrapling-extract-command-guide}++**ํ๋ก๊ทธ๋๋ฐ ์์ด ํฐ๋ฏธ๋์์ ์น ์คํฌ๋ํ์ ํ ์ ์์ต๋๋ค!**++`scrapling extract` ๋ช ๋ น์ ์ฝ๋๋ฅผ ์์ฑํ์ง ์๊ณ ๋ ํฐ๋ฏธ๋์์ ์น์ฌ์ดํธ์ ๋ด์ฉ์ ๋ค์ด๋ก๋ํ๊ณ ์ถ์ถํฉ๋๋ค. ์ด๋ณด์, ์ฐ๊ตฌ์, ์น ๋ฐ์ดํฐ๋ฅผ ๋น ๋ฅด๊ฒ ๊ฐ์ ธ์์ผ ํ๋ ์ฌ๋์๊ฒ ์ ํฉํฉ๋๋ค.++!!! success "์์ํ๊ธฐ ์ ์"++ 1. [Fetcher ๊ธฐ์ด](../fetching/choosing.md)๋ฅผ ์ฝ๊ณ [Response ๊ฐ์ฒด](../fetching/choosing.md#response-object)์ Fetcher ์ ํ ๋ฐฉ๋ฒ์ ์ดํดํ์ธ์.+ 2. [์์ ์ฐพ๊ธฐ](../parsing/selection.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector)/[Response](../fetching/choosing.md#response-object)์์ ์์๋ฅผ ์ฐพ๊ณ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์ดํดํ์ธ์.+ 3. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Response](../fetching/choosing.md#response-object)๊ฐ [Selector](../parsing/main_classes.md#selector)์์ ๋ฌผ๋ ค๋ฐ๋ ์์ฑ๊ณผ ๋ฉ์๋๋ฅผ ์์๋์ธ์.+ 4. ์ฌ์ฉํ Fetcher์ ๋ง๊ฒ [HTTP ์์ฒญ](../fetching/static.md) ๋๋ [๋ธ๋ผ์ฐ์ ๋ก ๊ฐ์ ธ์ค๊ธฐ](../fetching/stealthy.md) ์ค ํ๋ ์ด์์ ์ฝ์ผ์ธ์.+++## extract ๋ช ๋ น ๊ทธ๋ฃน์ด๋? {#what-is-the-extract-command-group}++extract๋ ๋ค์ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ ๊ฐ๋จํ ํฐ๋ฏธ๋ ๋๊ตฌ ๋ชจ์์ ๋๋ค.++- **์นํ์ด์ง๋ฅผ ๋ค์ด๋ก๋**ํ๊ณ ๋ด์ฉ์ ํ์ผ์ ์ ์ฅํฉ๋๋ค.+- **HTML์ ์ฝ๊ธฐ ์ฌ์ด ํ์์ผ๋ก ๋ณํ**ํฉ๋๋ค. Markdown์ผ๋ก ๋ฐ๊พธ๊ฑฐ๋, HTML๋ก ์ ์งํ๊ฑฐ๋, ํ ์คํธ๋ง ์ถ์ถํ ์ ์์ต๋๋ค.+- **์ง์ ์ง์ ํ CSS ์ ํ์**๋ก ํ์ด์ง์ ํน์ ๋ถ๋ถ์ ์ถ์ถํฉ๋๋ค.+- **HTTP ์์ฒญ๊ณผ ๋ธ๋ผ์ฐ์ ๋ฅผ ํตํ ๊ฐ์ ธ์ค๊ธฐ**๋ฅผ ์ง์ํฉ๋๋ค.+- **์ธ๋ถ ์ค์ ์ด ๊ฐ๋ฅํฉ๋๋ค.** ํค๋, ์ฟ ํค, ํ๋ก์ ๋ฑ์ ์ง์ ํ ์ ์์ต๋๋ค. ์ฝ๋์์ ์ฌ์ฉํ ์ ์๋ ๊ฑฐ์ ๋ชจ๋ ์ต์ ์ ๋ช ๋ น์ค์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.++!!! tip "AI์ฉ ๋ชจ๋"++ ๋ชจ๋ ์ถ์ถ ๋ช ๋ น์ `--ai-targeted` ํ๋๊ทธ๋ฅผ ์ง์ํฉ๋๋ค. ์ผ๋ฉด ๋ณธ๋ฌธ๋ง ์ถ์ถํ๊ณ ๋ถํ์ํ ํ๊ทธ(script, style, noscript, svg)๋ฅผ ์ ๊ฑฐํฉ๋๋ค. ํ๋กฌํํธ ์ธ์ ์ ์ ์ฐ์ผ ์ ์๋ ์จ๊ฒจ์ง ์์(์ธ๋ผ์ธ ์คํ์ผ๋ก ์จ๊ธด ์์, aria-hidden, ์จ๊ฒจ์ง ์ฌ๋กฏ, template ํ๊ทธ), ๋๋น๊ฐ 0์ธ Unicode ๋ฌธ์, HTML ์ฃผ์๋ ์ ๊ฑฐํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ๋ช ๋ น(`fetch`)์์๋ ๊ด๊ณ ์ฐจ๋จ๋ ์๋์ผ๋ก ์ผญ๋๋ค. ๊ฒฐ๊ณผ๋ฅผ AI ๋ชจ๋ธ์ ์ ๋ฌํ ๋ ์ ํฉํฉ๋๋ค.++## ๋น ๋ฅธ ์์ {#quick-start}++- **๊ธฐ๋ณธ ํ์ด์ง ๋ค์ด๋ก๋**++ ์น์ฌ์ดํธ ๋ด์ฉ์ ๊น๋ํ๊ณ ์ฝ๊ธฐ ์ฌ์ด ํ ์คํธ๋ก ๋ค์ด๋ก๋ํฉ๋๋ค.+ ```bash+ scrapling extract get "https://example.com" page_content.txt+ ```+ HTTP GET ์์ฒญ์ ๋ณด๋ด๊ณ ํ์ด์ง ํ ์คํธ๋ฅผ `page_content.txt`์ ์ ์ฅํฉ๋๋ค.++- **๋ค๋ฅธ ํ์์ผ๋ก ์ ์ฅํ๊ธฐ**++ ํ์ผ ํ์ฅ์๋ฅผ ๋ฐ๊ฟ ์ถ๋ ฅ ํ์์ ์ ํํฉ๋๋ค.+ ```bash+ # Convert the HTML content to Markdown, then save it to the file (great for documentation)+ scrapling extract get "https://blog.example.com" article.md++ # Save the HTML content as it is to the file+ scrapling extract get "https://example.com" page.html++ # Save a clean version of the text content of the webpage to the file+ scrapling extract get "https://example.com" content.txt++ # Or use the Docker image with something like this:+ docker run -v $(pwd)/output:/output pyd4vinci/scrapling extract get "https://blog.example.com" /output/article.md+ ```++- **ํน์ ๋ด์ฉ ์ถ์ถํ๊ธฐ**++ ๋ชจ๋ ๋ช ๋ น์์ `--css-selector` ๋๋ `-s`๋ก CSS ์ ํ์๋ฅผ ์ ๋ฌํด ํ์ด์ง์ ํน์ ๋ถ๋ถ์ ์ถ์ถํ ์ ์์ต๋๋ค. ์๋ ์์ ์์ ์ฌ์ฉ๋ฒ์ ํ์ธํ ์ ์์ต๋๋ค.++## ์ฌ์ฉํ ์ ์๋ ๋ช ๋ น {#available-commands}++`scrapling extract --help`๋ฅผ ์คํํ๋ฉด ๋ค์ ๋ช ๋ น ๋ชฉ๋ก์ ํ์ธํ ์ ์์ต๋๋ค.+```bash+Usage: scrapling extract [OPTIONS] COMMAND [ARGS]...++ Fetch web pages using various fetchers and extract full/selected HTML content as HTML, Markdown, or extract text content.++Options:+ --help Show this message and exit.++Commands:+ get Perform a GET request and save the content to a file.+ post Perform a POST request and save the content to a file.+ put Perform a PUT request and save the content to a file.+ delete Perform a DELETE request and save the content to a file.+ fetch Use StealthyFetcher to fetch content with advanced stealth features.+```++์๋์์ ๊ฐ ๋ช ๋ น์ ์์ธํ ์ค๋ช ํฉ๋๋ค.++### HTTP ์์ฒญ {#http-requests}++1. **GET ์์ฒญ**++ ์น์ฌ์ดํธ ๋ด์ฉ์ ๋ค์ด๋ก๋ํ ๋ ๊ฐ์ฅ ๋ง์ด ์ฐ๋ ๋ช ๋ น์ ๋๋ค.++ ```bash+ scrapling extract get [URL] [OUTPUT_FILE] [OPTIONS]+ ```++ **์์ :**+ ```bash+ # Basic download+ scrapling extract get "https://news.site.com" news.md++ # Download with custom timeout+ scrapling extract get "https://example.com" content.txt --timeout 60++ # Extract only specific content using CSS selectors+ scrapling extract get "https://blog.example.com" articles.md --css-selector "article"++ # Send a request with cookies+ scrapling extract get "https://scrapling.requestcatcher.com" content.md --cookies "session=abc123; user=john"++ # Add user agent+ scrapling extract get "https://api.site.com" data.txt -H "User-Agent: MyBot 1.0"++ # Add multiple headers+ scrapling extract get "https://site.com" page.html -H "Accept: text/html" -H "Accept-Language: en-US"+ ```+ `scrapling extract get --help`๋ก ์ฌ์ฉํ ์ ์๋ ์ต์ ์ ํ์ธํฉ๋๋ค.+ ```bash+ Usage: scrapling extract get [OPTIONS] URL OUTPUT_FILE++ Perform a GET request and save the content to a file.++ The output file path can be an HTML file, a Markdown file of the HTML content, or the text content itself. Use file extensions (`.html`/`.md`/`.txt`) respectively.++ Options:+ -H, --headers TEXT HTTP headers in format "Key: Value" (can be used multiple times)+ --cookies TEXT Cookies string in format "name1=value1;name2=value2"+ --timeout INTEGER Request timeout in seconds (default: 30)+ --proxy TEXT Proxy URL in format "http://username:password@host:port"+ -s, --css-selector TEXT CSS selector to extract specific content from the page. It returns all matches.+ -p, --params TEXT Query parameters in format "key=value" (can be used multiple times)+ --follow-redirects / --no-follow-redirects Whether to follow redirects (default: True)+ --verify / --no-verify Whether to verify SSL certificates (default: True)+ --impersonate TEXT Browser to impersonate (e.g., chrome, firefox).+ --stealthy-headers / --no-stealthy-headers Use stealthy browser headers (default: True)+ --ai-targeted Extract only main content and sanitize hidden elements for AI consumption (default: False)+ --help Show this message and exit.++ ```+ ๋ค๋ฅธ ์์ฒญ ๋ช ๋ น์์๋ ์ต์ ์ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์๋ํ๋ฏ๋ก ์ค๋ช ์ ๋ฐ๋ณตํ์ง ์๊ฒ ์ต๋๋ค.++2. **POST ์์ฒญ**++ ```bash+ scrapling extract post [URL] [OUTPUT_FILE] [OPTIONS]+ ```++ **์์ :**+ ```bash+ # Submit form data+ scrapling extract post "https://api.site.com/search" results.html --data "query=python&type=tutorial"++ # Send JSON data+ scrapling extract post "https://api.site.com" response.txt --json '{"username": "test", "action": "search"}'+ ```+ `scrapling extract post --help`๋ก ์ฌ์ฉํ ์ ์๋ ์ต์ ์ ํ์ธํฉ๋๋ค.+ ```bash+ Usage: scrapling extract post [OPTIONS] URL OUTPUT_FILE++ Perform a POST request and save the content to a file.++ The output file path can be an HTML file, a Markdown file of the HTML content, or the text content itself. Use file extensions (`.html`/`.md`/`.txt`) respectively.++ Options:+ -d, --data TEXT Form data to include in the request body (as string, ex: "param1=value1¶m2=value2")+ -j, --json TEXT JSON data to include in the request body (as string)+ -H, --headers TEXT HTTP headers in format "Key: Value" (can be used multiple times)+ --cookies TEXT Cookies string in format "name1=value1;name2=value2"+ --timeout INTEGER Request timeout in seconds (default: 30)+ --proxy TEXT Proxy URL in format "http://username:password@host:port"+ -s, --css-selector TEXT CSS selector to extract specific content from the page. It returns all matches.+ -p, --params TEXT Query parameters in format "key=value" (can be used multiple times)+ --follow-redirects / --no-follow-redirects Whether to follow redirects (default: True)+ --verify / --no-verify Whether to verify SSL certificates (default: True)+ --impersonate TEXT Browser to impersonate (e.g., chrome, firefox).+ --stealthy-headers / --no-stealthy-headers Use stealthy browser headers (default: True)+ --ai-targeted Extract only main content and sanitize hidden elements for AI consumption (default: False)+ --help Show this message and exit.++ ```++3. **PUT ์์ฒญ**++ ```bash+ scrapling extract put [URL] [OUTPUT_FILE] [OPTIONS]+ ```++ **์์ :**+ ```bash+ # Send data+ scrapling extract put "https://scrapling.requestcatcher.com/put" results.html --data "update=info" --impersonate "firefox"++ # Send JSON data+ scrapling extract put "https://scrapling.requestcatcher.com/put" response.txt --json '{"username": "test", "action": "search"}'+ ```+ `scrapling extract put --help`๋ก ์ฌ์ฉํ ์ ์๋ ์ต์ ์ ํ์ธํฉ๋๋ค.+ ```bash+ Usage: scrapling extract put [OPTIONS] URL OUTPUT_FILE++ Perform a PUT request and save the content to a file.++ The output file path can be an HTML file, a Markdown file of the HTML content, or the text content itself. Use file extensions (`.html`/`.md`/`.txt`) respectively.++ Options:+ -d, --data TEXT Form data to include in the request body+ -j, --json TEXT JSON data to include in the request body (as string)+ -H, --headers TEXT HTTP headers in format "Key: Value" (can be used multiple times)+ --cookies TEXT Cookies string in format "name1=value1;name2=value2"+ --timeout INTEGER Request timeout in seconds (default: 30)+ --proxy TEXT Proxy URL in format "http://username:password@host:port"+ -s, --css-selector TEXT CSS selector to extract specific content from the page. It returns all matches.+ -p, --params TEXT Query parameters in format "key=value" (can be used multiple times)+ --follow-redirects / --no-follow-redirects Whether to follow redirects (default: True)+ --verify / --no-verify Whether to verify SSL certificates (default: True)+ --impersonate TEXT Browser to impersonate (e.g., chrome, firefox).+ --stealthy-headers / --no-stealthy-headers Use stealthy browser headers (default: True)+ --ai-targeted Extract only main content and sanitize hidden elements for AI consumption (default: False)+ --help Show this message and exit.+ ```++4. **DELETE ์์ฒญ**++ ```bash+ scrapling extract delete [URL] [OUTPUT_FILE] [OPTIONS]+ ```++ **์์ :**+ ```bash+ # Send data+ scrapling extract delete "https://scrapling.requestcatcher.com/delete" results.html++ # Send JSON data+ scrapling extract delete "https://scrapling.requestcatcher.com/" response.txt --impersonate "chrome"+ ```+ `scrapling extract delete --help`๋ก ์ฌ์ฉํ ์ ์๋ ์ต์ ์ ํ์ธํฉ๋๋ค.+ ```bash+ Usage: scrapling extract delete [OPTIONS] URL OUTPUT_FILE++ Perform a DELETE request and save the content to a file.++ The output file path can be an HTML file, a Markdown file of the HTML content, or the text content itself. Use file extensions (`.html`/`.md`/`.txt`) respectively.++ Options:+ -H, --headers TEXT HTTP headers in format "Key: Value" (can be used multiple times)+ --cookies TEXT Cookies string in format "name1=value1;name2=value2"+ --timeout INTEGER Request timeout in seconds (default: 30)+ --proxy TEXT Proxy URL in format "http://username:password@host:port"+ -s, --css-selector TEXT CSS selector to extract specific content from the page. It returns all matches.+ -p, --params TEXT Query parameters in format "key=value" (can be used multiple times)+ --follow-redirects / --no-follow-redirects Whether to follow redirects (default: True)+ --verify / --no-verify Whether to verify SSL certificates (default: True)+ --impersonate TEXT Browser to impersonate (e.g., chrome, firefox).+ --stealthy-headers / --no-stealthy-headers Use stealthy browser headers (default: True)+ --ai-targeted Extract only main content and sanitize hidden elements for AI consumption (default: False)+ --help Show this message and exit.+ ```++### ๋ธ๋ผ์ฐ์ ๋ก ๊ฐ์ ธ์ค๊ธฐ {#browser-fetching}++JavaScript ํ์ด์ง, ๋ธ๋ผ์ฐ์ ์๋ํ, ๋ณดํธ๋ ์ฌ์ดํธ์๋ `fetch`๋ฅผ ์ฌ์ฉํ์ธ์. `StealthyFetcher`๋ฅผ ์คํํ๋ฉฐ ๋ชจ๋ ์คํ ์ค ์ต์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.++```bash+scrapling extract fetch "https://scrapling.requestcatcher.com/" content.md --network-idle+scrapling extract fetch "https://scrapling.requestcatcher.com/" data.txt --wait-selector ".content-loaded"+scrapling extract fetch "https://scrapling.requestcatcher.com/" page.html --no-headless --disable-resources+scrapling extract fetch "https://nopecha.com/demo/cloudflare" data.txt --solve-cloudflare --css-selector "#padded_content a"+scrapling extract fetch "https://site.com" content.md --proxy "http://proxy-server:8080"+```++์ด๋ฆฐ Shadow DOM์ ๋ด์ฉ์ ํฌํจํ๋ ค๋ฉด `--pierce-shadow`๋ฅผ ์ฌ์ฉํ์ธ์. ๊ธฐ๋ณธ์ผ๋ก ๊บผ์ ธ ์์ผ๋ฉฐ, `--no-pierce-shadow`๋ก ๋ช ์์ ์ผ๋ก ๋ ์๋ ์์ต๋๋ค. ์ ํ์ ์์ ์ ์ ํ ์ฌํญ์ [Shadow DOM](../fetching/stealthy.md#shadow-dom)์ ์ฐธ๊ณ ํ์ธ์.++```bash+scrapling extract fetch "https://example.com" content.md --pierce-shadow+```++`scrapling extract fetch --help`๋ก ๋ชจ๋ ์ต์ ์ ํ์ธํ์ธ์.++```text+Usage: scrapling extract fetch [OPTIONS] URL OUTPUT_FILE++ Use StealthyFetcher to fetch content with advanced stealth features.++Options:+ --headless / --no-headless Run browser in headless mode (default: True)+ --disable-resources / --enable-resources Drop unnecessary resources for speed boost (default: False)+ --block-webrtc / --allow-webrtc Block WebRTC entirely (default: False)+ --solve-cloudflare / --no-solve-cloudflare Solve Cloudflare challenges (default: False)+ --allow-webgl / --block-webgl Allow WebGL (default: True)+ --pierce-shadow / --no-pierce-shadow Include open Shadow DOM content (default: False)+ --network-idle / --no-network-idle Wait for network idle (default: False)+ --real-chrome/--no-real-chrome If you have a Chrome browser installed on your device, enable this, and the Fetcher will launch an instance of your browser and use it. (default: False)+ --timeout INTEGER Timeout in milliseconds (default: 30000)+ --wait INTEGER Additional wait time in milliseconds after page load (default: 0)+ -s, --css-selector TEXT CSS selector to extract specific content from the page. It returns all matches.+ --wait-selector TEXT CSS selector to wait for before proceeding+ --hide-canvas / --show-canvas Add noise to canvas operations (default: False)+ --locale TEXT Specify user locale. Defaults to the system default locale.+ --proxy TEXT Proxy URL in format "http://username:password@host:port"+ -H, --extra-headers TEXT Extra headers in format "Key: Value" (can be used multiple times)+ --dns-over-https / --no-dns-over-https Route DNS through Cloudflare's DoH to prevent DNS leaks when using proxies (default: False)+ --block-ads / --no-block-ads Block requests to known ad and tracker domains (default: False)+ --executable-path TEXT Path to a custom Chromium-compatible browser executable. Falls back to the SCRAPLING_EXECUTABLE_PATH environment variable when not set.+ --ai-targeted Extract only main content and sanitize hidden elements for AI consumption (default: False)+ --help Show this message and exit.+```++## ๋ช ๋ น ์ ํํ๊ธฐ {#when-to-use-each-command}++์น ์คํฌ๋ํ์ ์ต์ํ์ง ์์ ์ด๋ค ๋ช ๋ น์ ์ธ์ง ๊ณ ๋ฏผ๋๋ค๋ฉด ๋ค์ ๊ธฐ์ค์ผ๋ก ์ ํํ์ธ์.++- ๊ฐ๋จํ ์ฌ์ดํธ, ๋ธ๋ก๊ทธ, ๋ด์ค ๊ธฐ์ฌ์๋ **`get`**์ ์ฌ์ฉํฉ๋๋ค.+- JavaScript ํ์ด์ง, ๋ธ๋ผ์ฐ์ ์๋ํ, Cloudflare ๋ฑ์ผ๋ก ๋ณดํธ๋ ์ฌ์ดํธ์๋ **`fetch`**๋ฅผ ์ฌ์ฉํฉ๋๋ค.++## ๋ฒ์ ยท์ค๋ฆฌ์ ๊ณ ๋ ค ์ฌํญ {#legal-and-ethical-considerations}++โ ๏ธ **์ค์ํ ์ง์นจ:**++- **robots.txt ํ์ธ**: `https://website.com/robots.txt`์์ ์์ง ๊ท์น์ ํ์ธํ์ธ์.+- **์์ฒญ ๋น๋ ์ ํ ์ค์**: ์๋ฒ์ ์ง๋์น๊ฒ ๋ง์ ์์ฒญ์ ๋ณด๋ด์ง ๋ง์ธ์.+- **์ด์ฉ ์ฝ๊ด**: ์ฌ์ดํธ์ ์ฝ๊ด์ ์ฝ๊ณ ์งํค์ธ์.+- **์ ์๊ถ**: ์ง์์ฌ์ฐ๊ถ์ ์กด์คํ์ธ์.+- **๊ฐ์ธ์ ๋ณด**: ๊ฐ์ธ์ ๋ณด ๋ณดํธ๋ฒ์ ๊ณ ๋ คํ์ธ์.+- **์์ ์ ์ด์ฉ**: ์ ๋ฌด ๋ชฉ์ ์ ํ์ํ ํ๊ฐ๊ฐ ์๋์ง ํ์ธํ์ธ์.++---++*์ฆ๊ฒ๊ฒ ์คํฌ๋ํํ์ธ์! ์ฌ์ดํธ ์ ์ฑ ๊ณผ ์ ์ฉ๋๋ ๋ฒ๋ฅ ๋ฐ ๊ท์ ์ ํญ์ ์ง์ผ ์ฃผ์ธ์.*diff --git a/docs/locales/ko/cli/interactive-shell.md b/docs/locales/ko/cli/interactive-shell.mdnew file mode 100644index 0000000..93a5693--- /dev/null+++ b/docs/locales/ko/cli/interactive-shell.md@@ -0,0 +1,237 @@+---+title: "Scrapling ๋ํํ ์ ธ์์ ์น ์คํฌ๋ํ ํ ์คํธํ๊ธฐ"+description: "IPython ์ ธ์์ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ณ ์ ํ์๋ฅผ ์ํํ๋ฉฐ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ์ธ์. curl ๋ช ๋ น์ ๋ณํํ๊ณ ์ต๊ทผ ์๋ต์ ์ฌ์ฌ์ฉํ๋ฉฐ ์ฝ๋๋ฅผ ํ ์คํธํ ์ ์์ต๋๋ค."+---++# Scrapling ๋ํํ ์ ธ ์๋ด {#scrapling-interactive-shell-guide}++<script src="https://asciinema.org/a/736339.js" id="asciicast-736339" async data-autoplay="1" data-loop="1" data-cols="225" data-rows="40" data-start-at="00:06" data-speed="1.5" data-theme="tango"></script>++**๊ฐ๋ฐ์์ ๋ฐ์ดํฐ ๊ณผํ์๋ฅผ ์ํ ์น ์คํฌ๋ํ REPL**++Scrapling ๋ํํ ์ ธ์ ์น ์คํฌ๋ํ์ ๋ง๊ฒ ํ์ฅํ IPython ๊ธฐ๋ฐ ํ๊ฒฝ์ ๋๋ค. ๋ชจ๋ Scrapling ๊ธฐ๋ฅ์ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. ํธ๋ฆฌํ ๋จ์ถ ํจ์, ์๋ ํ์ด์ง ๊ด๋ฆฌ, curl ๋ช ๋ น ๋ณํ ๊ฐ์ ๊ธฐ๋ฅ๋ ์ ๊ณตํฉ๋๋ค.++!!! success "์์ํ๊ธฐ ์ ์"++ 1. [Fetcher ๊ธฐ์ด](../fetching/choosing.md)๋ฅผ ์ฝ๊ณ [Response ๊ฐ์ฒด](../fetching/choosing.md#response-object)์ Fetcher ์ ํ ๋ฐฉ๋ฒ์ ์ดํดํ์ธ์.+ 2. [์์ ์ฐพ๊ธฐ](../parsing/selection.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector)/[Response](../fetching/choosing.md#response-object)์์ ์์๋ฅผ ์ฐพ๊ณ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์ดํดํ์ธ์.+ 3. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Response](../fetching/choosing.md#response-object)๊ฐ [Selector](../parsing/main_classes.md#selector)์์ ๋ฌผ๋ ค๋ฐ๋ ์์ฑ๊ณผ ๋ฉ์๋๋ฅผ ์์๋์ธ์.+ 4. ์ฌ์ฉํ Fetcher์ ๋ง๊ฒ [HTTP ์์ฒญ](../fetching/static.md) ๋๋ [๋ธ๋ผ์ฐ์ ๋ก ๊ฐ์ ธ์ค๊ธฐ](../fetching/stealthy.md) ์ค ํ๋ ์ด์์ ์ฝ์ผ์ธ์.+++## ๋ํํ ์ ธ์ ์ฌ์ฉํ๋ ์ด์ {#why-use-the-interactive-shell}++๋ํํ ์ ธ์์๋ ์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ๊ณ ์คํํ๋ ๊ณผ์ ์ ๋งค๋ฒ ๋ฐ๋ณตํ์ง ์์๋ ๋ฉ๋๋ค. ๊ทธ ์๋ฆฌ์์ ๋น ๋ฅด๊ฒ ์๋ํ๋ฉฐ ์คํฌ๋ํํ ์ ์์ต๋๋ค. ๋ค์ ์์ ์ ์ ํฉํฉ๋๋ค.++- **๋น ๋ฅธ ํ๋กํ ํ์ ์์ฑ**: ์คํฌ๋ํ ๋ฐฉ๋ฒ์ ๋ฐ๋ก ํ ์คํธํฉ๋๋ค.+- **๋ฐ์ดํฐ ํ์**: ๋ํํ์ผ๋ก ์น์ฌ์ดํธ๋ฅผ ์ดํด๋ณด๊ณ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํฉ๋๋ค.+- **Scrapling ํ์ต**: ๊ธฐ๋ฅ์ ์ง์ ์คํํ๋ฉฐ ๋ฐฐ์๋๋ค.+- **์คํฌ๋ํผ ๋๋ฒ๊น **: ์์ฒญ์ ๋จ๊ณ๋ณ๋ก ์คํํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํฉ๋๋ค.+- **์์ ๋ฐฉ์ ๋ณํ**: ๋ธ๋ผ์ฐ์ DevTools์ curl ๋ช ๋ น์ ํ ์ค๋ก Fetcher ์์ฒญ์ผ๋ก ๋ฐ๊ฟ๋๋ค.++## ์์ํ๊ธฐ {#getting-started}++### ์ ธ ์คํ {#launch-the-shell}++```bash+# Start the interactive shell+scrapling shell++# Execute code and exit (useful for scripting)+scrapling shell -c "get('https://quotes.toscrape.com'); print(len(page.css('.quote')))"++# Set logging level+scrapling shell --loglevel info+```++์คํํ๋ฉด Scrapling ๋ฐฐ๋๊ฐ ํ์๋ฉ๋๋ค. ์ ์์์ฒ๋ผ ๋ฐ๋ก ์คํฌ๋ํ์ ์์ํ ์ ์์ต๋๋ค.++```python+# No imports needed - everything is ready!+get('https://news.ycombinator.com')++# Explore the page structure+page.css('a')[:5] # Look at first 5 links++# Refine your selectors+stories = page.css('.titleline>a')+len(stories) # 30++# Extract specific data+for story in stories[:3]:+ title = story.text+ url = story['href']+ print(f"{title}: {url}")++# Try different approaches+titles = page.css('.titleline>a::text') # Direct text extraction+urls = page.css('.titleline>a::attr(href)') # Direct attribute extraction+```++## ๊ธฐ๋ณธ ์ ๊ณต ๋จ์ถ ํจ์ {#built-in-shortcuts}++๋ฐ๋ณต๋๋ ์ฝ๋๋ฅผ ์ค์ด๊ธฐ ์ํ ๋จ์ถ ํจ์๋ฅผ ์ ๊ณตํฉ๋๋ค.++- **`get(url, **kwargs)`**: HTTP GET ์์ฒญ. `Fetcher.get` ๋์ ์ฌ์ฉํฉ๋๋ค.+- **`post(url, **kwargs)`**: HTTP POST ์์ฒญ. `Fetcher.post` ๋์ ์ฌ์ฉํฉ๋๋ค.+- **`put(url, **kwargs)`**: HTTP PUT ์์ฒญ. `Fetcher.put` ๋์ ์ฌ์ฉํฉ๋๋ค.+- **`delete(url, **kwargs)`**: HTTP DELETE ์์ฒญ. `Fetcher.delete` ๋์ ์ฌ์ฉํฉ๋๋ค.+- **`fetch(url, **kwargs)`**: ์คํ ์ค ๋ธ๋ผ์ฐ์ ๋ก ๊ฐ์ ธ์ค๊ธฐ. `StealthyFetcher.fetch` ๋์ ์ฌ์ฉํฉ๋๋ค.++`Fetcher`, `AsyncFetcher`, `StealthyFetcher`, `Selector`์ฒ๋ผ ์์ฃผ ์ฐ๋ ํด๋์ค๋ ๊ฐ์ ธ์ค๊ธฐ ๊ตฌ๋ฌธ ์์ด ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.++### ์๋ ํ์ด์ง ๊ด๋ฆฌ {#smart-page-management}++์ ธ์ ์์ฒญ๊ณผ ํ์ด์ง๋ฅผ ์๋์ผ๋ก ์ถ์ ํฉ๋๋ค.++- **ํ์ฌ ํ์ด์ง ์ ๊ทผ**++ `page`์ `response`๋ ๋ง์ง๋ง์ผ๋ก ๊ฐ์ ธ์จ ํ์ด์ง๋ก ์๋ ๊ฐฑ์ ๋ฉ๋๋ค.++ ```python+ get('https://quotes.toscrape.com')+ # 'page' and 'response' both refer to the last fetched page+ page.url # 'https://quotes.toscrape.com'+ response.status # Prints 200; Same as page.status+ ```++- **ํ์ด์ง ๊ธฐ๋ก**++ `pages`๋ ์ต๊ทผ ๋ค์ฏ ํ์ด์ง๋ฅผ ๋ณด๊ดํ๋ `Selectors` ๊ฐ์ฒด์ ๋๋ค.++ ```python+ get('https://site1.com')+ get('https://site2.com')+ get('https://site3.com')++ # Access last 5 pages+ len(pages) # `Selectors` object with `page` history -> 3+ pages[0].url # First page in history -> 'https://site1.com'+ pages[-1].url # Most recent page -> 'https://site3.com'++ # Work with historical pages+ for i, old_page in enumerate(pages):+ print(f"Page {i}: {old_page.url} - {old_page.status}")+ ```++## ๊ธฐํ ์ ์ฉํ ๋ช ๋ น {#additional-helpful-commands}++### ํ์ด์ง ๋ณด๊ธฐ {#page-visualization}++๊ฐ์ ธ์จ ํ์ด์ง๋ฅผ ๋ธ๋ผ์ฐ์ ์์ ํ์ธํ์ธ์.++```python+get('https://quotes.toscrape.com')+view(page) # Opens the page HTML in your default browser+```++### curl ๋ช ๋ น ์ฐ๋ {#curl-command-integration}++๋ธ๋ผ์ฐ์ DevTools์ curl ๋ช ๋ น์ `Fetcher` ์์ฒญ์ผ๋ก ๋ฐ๊ฟ ์ ์๋๋ก `uncurl`๊ณผ `curl2fetcher` ํจ์๋ฅผ ์ ๊ณตํฉ๋๋ค.++๋จผ์ ๋ค์๊ณผ ๊ฐ์ด ์์ฒญ์ curl ๋ช ๋ น์ผ๋ก ๋ณต์ฌํ์ธ์.++<img src="../assets/scrapling_shell_curl.png" title="Chrome์ ์์ฒญ์ curl ๋ช ๋ น์ผ๋ก ๋ณต์ฌํ๊ธฐ" alt="Chrome์ ์์ฒญ์ curl ๋ช ๋ น์ผ๋ก ๋ณต์ฌํ๊ธฐ" style="width: 70%;"/>++- **curl ๋ช ๋ น์ Request ๊ฐ์ฒด๋ก ๋ณํํ๊ธฐ**++ ```python+ curl_cmd = '''curl 'https://scrapling.requestcatcher.com/post' \+ -X POST \+ -H 'Content-Type: application/json' \+ -d '{"name": "test", "value": 123}' '''++ request = uncurl(curl_cmd)+ request.method # -> 'post'+ request.url # -> 'https://scrapling.requestcatcher.com/post'+ request.headers # -> {'Content-Type': 'application/json'}+ ```++- **curl ๋ช ๋ น ๋ฐ๋ก ์คํํ๊ธฐ**++ ```python+ # Convert and execute in one step+ curl2fetcher(curl_cmd)+ page.status # -> 200+ ```++### IPython ๊ธฐ๋ฅ {#ipython-features}++์ ธ์ IPython์ ๋ชจ๋ ๊ธฐ๋ฅ์ ์ง์ํฉ๋๋ค.++```python+# Magic commands+%time page = get('https://example.com') # Time execution+%history # Show command history+%save filename.py 1-10 # Save commands 1-10 to file++# Tab completion works everywhere+page.c<TAB> # Shows: css, cookies, headers, etc.+Fetcher.<TAB> # Shows all Fetcher methods++# Object inspection+get? # Show get documentation+```++## ์์ {#examples}++AI๋ก ์์ฑํ ๋ช ๊ฐ์ง ์์ ์ ๋๋ค.++#### ์ผํ๋ชฐ ๋ฐ์ดํฐ ์์ง {#e-commerce-data-collection}++```python+# Start with product listing page+catalog = get('https://shop.example.com/products')++# Find product links+product_links = catalog.css('.product-link::attr(href)').getall()+print(f"Found {len(product_links)} products")++# Sample a few products first+for link in product_links[:3]:+ product = get(catalog.urljoin(link))+ name = product.css('.product-name::text').get('')+ price = product.css('.price::text').get('')+ print(f"{name}: {price}")++# Scale up with sessions for efficiency+from scrapling.fetchers import FetcherSession+with FetcherSession() as session:+ products = []+ for link in product_links:+ product = session.get(catalog.urljoin(link))+ products.append({+ 'name': product.css('.product-name::text').get(''),+ 'price': product.css('.price::text').get(''),+ 'url': link+ })+```++#### API ์ฐ๋๊ณผ ํ ์คํธ {#api-integration-and-testing}++```python+>>> # Test API endpoints interactively+>>> response = get('https://jsonplaceholder.typicode.com/posts/1')+>>> response.json()+{'userId': 1, 'id': 1, 'title': 'sunt aut...', 'body': 'quia et...'}++>>> # Test POST requests+>>> new_post = post('https://jsonplaceholder.typicode.com/posts',+... json={'title': 'Test Post', 'body': 'Test content', 'userId': 1})+>>> new_post.json()['id']+101++>>> # Test with different data+>>> updated = put('https://jsonplaceholder.typicode.com/posts/1',+... json={'title': 'Updated Title'})+```++## ๋์๋ง {#getting-help}++ํฐ๋ฏธ๋์ ์๋ ๋์๋ง๋ก ๋ถ์กฑํ๋ค๋ฉด ๋ค์์ ์ด์ฉํ์ธ์.++- [Scrapling ๋ฌธ์](https://scrapling.readthedocs.io/en/latest/ko/)+- [Discord ์ปค๋ฎค๋ํฐ](https://discord.gg/EMgGbDceNQ)+- [GitHub Issues](https://github.com/D4Vinci/Scrapling/issues)++์ด์ ์ค๋น๊ฐ ๋๋ฌ์ต๋๋ค. ์ฆ๊ฒ๊ฒ ์คํฌ๋ํํ์ธ์! ์ ธ์ ์ฌ์ฉํ๋ฉด ๋ํํ๋ฏ ์ฝ๊ฒ ์น ์คํฌ๋ํ์ ์งํํ ์ ์์ต๋๋ค.diff --git a/docs/locales/ko/cli/overview.md b/docs/locales/ko/cli/overview.mdnew file mode 100644index 0000000..b4b3075--- /dev/null+++ b/docs/locales/ko/cli/overview.md@@ -0,0 +1,35 @@+---+title: "Scrapling CLI: ํฐ๋ฏธ๋์์ ์คํฌ๋ํํ๊ธฐ"+description: "Scrapling ํฐ๋ฏธ๋ ๋๊ตฌ๋ฅผ ์ค์นํ๊ณ ์ถ์ถ ๋ช ๋ น, ๋ํํ ์ ธ, MCP ์๋ฒ ์ค์์ ์ ํํ์ธ์. ์์ ์ ๋ง๋ ์๋ด๋ฅผ ํ์ธํ ์ ์์ต๋๋ค."+---++# ๋ช ๋ น์ค ์ธํฐํ์ด์ค {#command-line-interface}++Scrapling v0.3๋ถํฐ ๋ค์ ์ธ ๊ฐ์ง ์ฃผ์ ๊ธฐ๋ฅ์ ๊ฐ์ถ ๋ช ๋ น์ค ์ธํฐํ์ด์ค๋ฅผ ์ ๊ณตํฉ๋๋ค.++1. **๋ํํ ์ ธ**: IPython ๊ธฐ๋ฐ ์น ์คํฌ๋ํ ์ ธ์ ๋๋ค. ํธ๋ฆฌํ ๋จ์ถ ํจ์์ ๋๊ตฌ๋ฅผ ์ ๊ณตํฉ๋๋ค.+2. **์ถ์ถ ๋ช ๋ น**: ํ๋ก๊ทธ๋๋ฐ ์์ด ํฐ๋ฏธ๋์์ ์น์ฌ์ดํธ๋ฅผ ์คํฌ๋ํํฉ๋๋ค.+3. **์ ํธ๋ฆฌํฐ ๋ช ๋ น**: ์ค์น์ ๊ด๋ฆฌ๋ฅผ ์ํ ๋๊ตฌ์ ๋๋ค.++```bash+# Launch interactive shell+scrapling shell++# Convert the content of a page to markdown and save it to a file+scrapling extract get "https://example.com" content.md++# Get help for any command+scrapling --help+scrapling extract --help+```++## ์๊ตฌ ์ฌํญ {#requirements}+์ด ์น์ ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด `shell` ์ถ๊ฐ ์์กด์ฑ ๊ทธ๋ฃน์ ์ค์นํ์ธ์.+```bash+pip install "scrapling[shell]"+```+๋ธ๋ผ์ฐ์ ๋ก ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด ๋ธ๋ผ์ฐ์ ์์กด์ฑ๋ ์ค์นํ์ธ์.+```bash+scrapling install+```+Chromium๊ณผ ์์คํ ์์กด์ฑ์ ๋ค์ด๋ก๋ํ๊ณ TLD ๋ชฉ๋ก์ ๊ฐฑ์ ํฉ๋๋ค. HTTP ์์ฒญ๋ง ์ฌ์ฉํ ๋๋ ์ด ๋จ๊ณ๊ฐ ํ์ํ์ง ์์ต๋๋ค.diff --git a/docs/locales/ko/development/adaptive_storage_system.md b/docs/locales/ko/development/adaptive_storage_system.mdnew file mode 100644index 0000000..4b2e6c4--- /dev/null+++ b/docs/locales/ko/development/adaptive_storage_system.md@@ -0,0 +1,73 @@+---+title: "์ ์ํ ํ์ฑ์ ์ํ ์ ์ฅ์ ๋ง๋ค๊ธฐ"+description: "Scrapling์ ์ ์ํ ํ์ฑ์ ์ํ save์ retrieve๋ฅผ ๊ตฌํํ์ธ์. Redis ์ ์ฅ์๋ฅผ ๋ง๋ค์ด ์์ ์์ฑ์ ์ ์ฅํ๊ณ ๊ฐ์ ธ์ต๋๋ค."+---++# ์ ์ฅ๊ณผ ๊ฒ์ ์์คํ ๋ง๋ค๊ธฐ {#writing-your-retrieval-system}++Scrapling์ ๊ธฐ๋ณธ์ ์ผ๋ก SQLite๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ด ์๋ด์์๋ `adaptive` ๊ธฐ๋ฅ์ ํ์ํ ์์ ์์ฑ์ ์ง์ ๋ง๋ ์ ์ฅ์์ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค.++์๋ฅผ ๋ค์ด Firebase๋ฅผ ์ฌ์ฉํด ์ฌ๋ฌ ์ปดํจํฐ์์ ์คํํ๋ ์คํ์ด๋๊ฐ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๊ณต์ ํ๋๋ก ๋ง๋ค ์ ์์ต๋๋ค. ์ด๋ฐ ์จ๋ผ์ธ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฐ๋ฉด ์คํ์ด๋ ์ฌ์ด์์ ์ ์ํ ๋ฐ์ดํฐ๋ฅผ ๊ณต์ ํ ์ ์์ต๋๋ค.++์ ์ฅ์ ํด๋์ค๋ ๋ค์ ์ธ ๊ฐ์ง ์กฐ๊ฑด์ ๋ง์กฑํด์ผ ํฉ๋๋ค.++1. ์ถ์ ํด๋์ค `scrapling.core.storage.StorageSystemMixin`์ ์์ํ๊ณ ๋ฌธ์์ด ์ธ์๋ฅผ ๋ฐ์ต๋๋ค. ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋์์ ์ ์งํ๊ธฐ ์ํ `url` ์ธ์์ ๋๋ค.+2. ํด๋์ค ์์ `functools.lru_cache` ๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ์ฌ์ฉํด ๋ค๋ฅธ ํด๋์ค์ฒ๋ผ Singleton ํจํด์ ๋ฐ๋ฆ ๋๋ค.+3. ํ์ ํํธ์ ๋ง๊ฒ `save`์ `retrieve`๋ฅผ ๊ตฌํํฉ๋๋ค.+ - `save`๋ ์๋ฌด๊ฒ๋ ๋ฐํํ์ง ์์ผ๋ฉฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ธ์ ๋ ๊ฐ๋ฅผ ๋ฐ์ต๋๋ค.+ * ์ฒซ ๋ฒ์งธ๋ ์์ ์์ฒด์ธ `lxml.html.HtmlElement`์ ๋๋ค. ๊ฐ์ ํ์์ ์ ์งํ๋ ค๋ฉด `scrapling.core.utils._StorageTools` ํ์ ๋ชจ๋์ `element_to_dict`๋ก ๋์ ๋๋ฆฌ๋ก ๋ฐ๊พผ ๋ค ์ํ๋ ๋ฐฉ์์ผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅํ์ธ์.+ * ๋ ๋ฒ์งธ๋ ๊ฒ์์ ์ฌ์ฉํ ๋ฌธ์์ด ์๋ณ์์ ๋๋ค. ์ด๊ธฐํํ ๋ ๋ฐ์ `url`๊ณผ ์ด ์๋ณ์๋ฅผ ์กฐํฉํ ๊ฐ์ ๊ฐ ํ๋ง๋ค ๊ณ ์ ํด์ผ ํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด `adaptive` ๋ฐ์ดํฐ๊ฐ ์์ ๋๋ค.+ - `retrieve`๋ ๋ฌธ์์ด ์๋ณ์๋ฅผ ๋ฐ์ต๋๋ค. ์ด๊ธฐํํ ๋ ๋ฐ์ `url`๊ณผ ํจ๊ป ์ฌ์ฉํด ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ์์์ ๋์ ๋๋ฆฌ๋ฅผ ์ฐพ๊ณ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด `None`์ ๋ฐํํฉ๋๋ค.++> ๋ ์์ธํ ์๊ฐ ํ์ํ๋ฉด [storage_adaptors](https://github.com/D4Vinci/Scrapling/blob/main/scrapling/core/storage.py) ํ์ผ์ SQLite3 ๊ตฌํ์ ์ดํด๋ณด์ธ์.++์ด ์กฐ๊ฑด์ ๋ง์กฑํ๋ฉด ๋๋จธ์ง๋ ๊ฐ๋จํฉ๋๋ค. ์ฌ๋ฌ ์ค๋ ๋๋ฅผ ์ฌ์ฉํ๋ ์ฑ์ด๋ผ๋ฉด ํด๋์ค๊ฐ ์์ ํ๊ฒ ๋์ํ๋์ง ํ์ธํ์ธ์. ๊ธฐ๋ณธ ์ ์ฅ์ ํด๋์ค๋ ์ค๋ ๋ ์์ ์ฑ์ ์ ๊ณตํฉ๋๋ค.++์ถ์ ํด๋์ค์๋ ์ฌ์ฉํ ์ ์๋ ๋ณด์กฐ ํจ์๋ ์์ต๋๋ค. ์ค๋ช ์ด ์์ธํ ์๋ [์ฝ๋](https://github.com/D4Vinci/Scrapling/blob/main/scrapling/core/storage.py)๋ฅผ ์ดํด๋ณด์ธ์ :)+++## ์ค์ ์: Redis ์ ์ฅ์ {#real-world-example-redis-storage}++๋ค์์ AI๋ก ๋ง๋ Redis ์ ์ฅ์ ์์ ๋๋ค.++```python+import redis+import orjson+from functools import lru_cache+from scrapling.core.storage import StorageSystemMixin+from scrapling.core.utils import _StorageTools++@lru_cache(None)+class RedisStorage(StorageSystemMixin):+ def __init__(self, host='localhost', port=6379, db=0, url=None):+ super().__init__(url)+ self.redis = redis.Redis(+ host=host,+ port=port,+ db=db,+ decode_responses=False+ )++ def save(self, element, identifier: str) -> None:+ # Convert element to dictionary+ element_dict = _StorageTools.element_to_dict(element)++ # Create key+ key = f"scrapling:{self._get_base_url()}:{identifier}"++ # Store as JSON+ self.redis.set(+ key,+ orjson.dumps(element_dict)+ )++ def retrieve(self, identifier: str) -> dict | None:+ # Get data+ key = f"scrapling:{self._get_base_url()}:{identifier}"+ data = self.redis.get(key)++ # Parse JSON if exists+ if data:+ return orjson.loads(data)+ return None+```diff --git a/docs/locales/ko/development/scrapling_custom_types.md b/docs/locales/ko/development/scrapling_custom_types.mdnew file mode 100644index 0000000..05bdb79--- /dev/null+++ b/docs/locales/ko/development/scrapling_custom_types.md@@ -0,0 +1,27 @@+---+title: "์ฝ๋์์ Scrapling ํ ์คํธ์ ์์ฑ ํ์ ์ฌ์ฉํ๊ธฐ"+description: "ํ์ ๋ฐ์์๋ TextHandler, TextHandlers, AttributesHandler๋ฅผ ์ฌ์ฉํ์ธ์. ๊ธฐ๋ณธ Python ํ์ , JSON ๋๊ตฌ, ์ฝ๊ธฐ ์ ์ฉ ์์ฑ์ ์์๋ด ๋๋ค."+---++# Scrapling์ ์ฌ์ฉ์ ์ ์ ํ์ ์ฌ์ฉํ๊ธฐ {#using-scraplings-custom-types}++> Scrapling์ฉ์ผ๋ก ๋ง๋ ํ์ ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฐ์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ฝ๋๋ฅผ ๋ณต์ฌํ๋ ๊ฒ๋ณด๋ค ํธ๋ฆฌํฉ๋๋ค :)++### ๋ชจ๋ ํ์ ์ ๊ฐ๋ณ์ ์ผ๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค {#all-current-types-can-be-imported-alone-like-below}+```python+from scrapling.core.custom_types import TextHandler, AttributesHandler++somestring = TextHandler('{}')+parsed = somestring.json()+somedict_1 = AttributesHandler({'a': 1})+somedict_2 = AttributesHandler(a=1)+```++`TextHandler`๋ Python์ `str`์ ์์ํ๋ฏ๋ก ํ์ค ๋ฌธ์์ด ์ฐ์ฐ๊ณผ ๋ฉ์๋๋ฅผ ๋ชจ๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.+`parsed`๋ ๋ฌธ์์ด `'{}'`๊ฐ ์๋๋ผ ๋์ ๋๋ฆฌ `{}`์ ๋๋ค. ์ธ์คํด์ค๋ฅผ ํ์ธํ๋ ค๋ฉด `isinstance(somestring, TextHandler)`๋ฅผ, ํด๋์ค๋ฅผ ํ์ธํ๋ ค๋ฉด `issubclass(TextHandler, str)`์ ์ฌ์ฉํ์ธ์.++`AttributesHandler`๋ `collections.abc.Mapping`์ ์์ํ๋ฉฐ, ๋ณ๊ฒฝํ ์ ์๋ ์ฝ๊ธฐ ์ ์ฉ ๋งคํ์ ๋๋ค. ์ฐ์ฐ์ ๊ธฐ๋ฐ ํด๋์ค์์ ์์ํฉ๋๋ค. ์ ๋ฌํ ๋ฐ์ดํฐ๋ `_data`๋ก ์ ๊ทผํ ์ ์์ง๋ง, ์ด๊ฒ๋ ์ฝ๊ธฐ ์ ์ฉ์ธ `types.MappingProxyType`์ ๋๋ค. `collections.abc.Mapping`๋ณด๋ค ์กฐ๊ธ ๋ ๋น ๋ฆ ๋๋ค.++Python์ ์ฒ์ ์ฌ์ฉํ๋ค๋ฉด ์ด๋ ๊ฒ ์ดํดํ๋ฉด ๋ฉ๋๋ค. `AttributesHandler`์์๋ ์ค์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ๊พธ๋ ์ฐ์ฐ์ ์ ์ธํ๊ณ ํ์ค `dict`์ ์ฐ์ฐ๊ณผ ๋ฉ์๋๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.++`AttributesHandler`์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ๊พธ๋ ค๋ฉด ๋จผ์ `dict` ๊ฐ์ ํจ์๋ก ์ผ๋ฐ ๋์ ๋๋ฆฌ๋ก ๋ณํํ ๋ค ๊ทธ ๋์ ๋๋ฆฌ๋ฅผ ์์ ํ์ธ์.diff --git a/docs/locales/ko/donate.md b/docs/locales/ko/donate.mdnew file mode 100644index 0000000..d17d86c--- /dev/null+++ b/docs/locales/ko/donate.md@@ -0,0 +1,37 @@+---+title: "Scrapling ๊ฐ๋ฐ ํ์ํ๊ธฐ"+description: "GitHub Sponsors๋ Buy Me a Coffee๋ก Scrapling์ ์ง์ํ์ธ์. ๊ด๊ณ ์๊ธ์ ์ ํ์ ํํ๋ ํ์ธํ ์ ์์ต๋๋ค."+---++# ํ์๊ณผ ๊ด๊ณ {#support-and-advertisement}++์ ๋ ์ฌ๊ฐ ์๊ฐ์ ์ด ํ๋ก์ ํธ๋ค์ ๋ง๋ค๊ณ , ๋ฌด๋ฃ๋ก ์ ๊ณตํ๊ธฐ ์ํด ๋ง์ ์๊ฐ๊ณผ ๋น์ฉ์ ๋ค์ด๊ณ ์์ต๋๋ค. ํ์์ ์ปคํผ๋ฅผ ์ฑ์ฐ๊ณ ์ํ๋น๋ฅผ ๊ฐ๋นํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. ๊ธฐ์กด ํ๋ก์ ํธ๋ฅผ ๊ณ์ ๊ฐ์ ํ๊ณ ์๋ก์ด ํ๋ก์ ํธ๋ฅผ ๋ง๋๋ ํ๋ ๋ฉ๋๋ค.++[GitHub Sponsors](https://github.com/sponsors/D4Vinci)๋ [Buy Me a Coffee](https://buymeacoffee.com/d4vinci)๋ก ํ์ํ ์ ์์ต๋๋ค.++๊ฐ์ฌํฉ๋๋ค. ๊ณ์ ๋ฐฐ์ฐ๊ณ ์๋ก์ด ๊ฒ์ ๋ง๋ค์ด ๋ณด์ธ์! โค๏ธ++## ๊ด๊ณ {#advertisement}+์ด ์ปค๋ฎค๋ํฐ์ ํ์ฌ๋ฅผ **ํ๋ณด**ํ๊ณ ์ถ๋ค๋ฉด [๊ด๊ณ ์๊ธ์ ](https://github.com/sponsors/D4Vinci)๋ฅผ ํ์ธํ์ธ์:++### 1. [Silver ์๊ธ์ ](https://github.com/sponsors/D4Vinci/sponsorships?tier_id=435495) (์ $100) {#1-the-silver-tier-100month}+ํํ:++1. [Scrapling ํ๋ก์ ํธ ํ์ด์ง ์๋จ](https://github.com/D4Vinci/Scrapling?tab=readme-ov-file#sponsors)์ ๋ก๊ณ ๋ฅผ ํ์ํฉ๋๋ค.+2. [PyPI ํ์ด์ง ์๋จ](https://pypi.org/project/scrapling/)๊ณผ [Docker ์ด๋ฏธ์ง ํ์ด์ง ์๋จ](https://hub.docker.com/r/pyd4vinci/scrapling)์๋ ํ๋ก์ ํธ ํ์ด์ง์ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ก๊ณ ๋ฅผ ํ์ํฉ๋๋ค.++### 2. [Gold ์๊ธ์ ](https://github.com/sponsors/D4Vinci/sponsorships?tier_id=591422) (์ $200) {#2-the-gold-tier-200month}+ํํ:++1. [Scrapling ํ๋ก์ ํธ ํ์ด์ง ์๋จ](https://github.com/D4Vinci/Scrapling?tab=readme-ov-file#sponsors)์ ๋ก๊ณ ๋ฅผ ํ์ํฉ๋๋ค.+2. [PyPI ํ์ด์ง ์๋จ](https://pypi.org/project/scrapling/)๊ณผ [Docker ์ด๋ฏธ์ง ํ์ด์ง ์๋จ](https://hub.docker.com/r/pyd4vinci/scrapling)์๋ ํ๋ก์ ํธ ํ์ด์ง์ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ก๊ณ ๋ฅผ ํ์ํฉ๋๋ค.+3. [Scrapling ์ฌ์ดํธ](https://scrapling.readthedocs.io/en/latest/ko/)์ ์ฃผ์ ํ์์ฌ ๋ชฉ๋ก์ ๋ก๊ณ ๋ฅผ ํ์ํฉ๋๋ค.++### 3. [Platinum ์๊ธ์ ](https://github.com/sponsors/D4Vinci/sponsorships?tier_id=586646) (์ $300) {#3-the-platinum-tier-300month}+ํํ:++1. [Scrapling ํ๋ก์ ํธ ํ์ด์ง ๋งจ ์](https://github.com/D4Vinci/Scrapling?tab=readme-ov-file#platinum-sponsors)์ ๋์ ๋๋ ์๋ฆฌ์ ๋ก๊ณ ์ 25๋จ์ด ์ดํ์ ์๊ฐ๋ฅผ ํ์ํฉ๋๋ค.+2. [PyPI ํ์ด์ง](https://pypi.org/project/scrapling/)์ [Docker ํ์ด์ง](https://hub.docker.com/r/pyd4vinci/scrapling)์๋ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ก๊ณ ๋ฅผ ํ์ํฉ๋๋ค.+3. [Scrapling ์ฌ์ดํธ](https://scrapling.readthedocs.io/en/latest/ko/)์ ์ฃผ์ ํ์์ฌ ๋ชฉ๋ก์์ ๋ก๊ณ ๋ฅผ ๋์ ๋๋ ์๋ฆฌ์ ํ์ํฉ๋๋ค.+4. Discord ํํธ๋ ์ญํ ์ ๋ถ์ฌํ๊ณ Twitter์ Discord์์ ์๊ฐํฉ๋๋ค.+5. ๊ฐ ๋ฆด๋ฆฌ์ค ๋ ธํธ ๋์ ํ์์ฌ๋ก ์๊ฐํฉ๋๋ค.\ No newline at end of filediff --git a/docs/locales/ko/fetching/choosing.md b/docs/locales/ko/fetching/choosing.mdnew file mode 100644index 0000000..a2ee975--- /dev/null+++ b/docs/locales/ko/fetching/choosing.md@@ -0,0 +1,95 @@+---+title: "์น ์คํฌ๋ํ์ HTTP ์์ฒญ๊ณผ ๋ธ๋ผ์ฐ์ ์ค ๋ฌด์์ ์ธ๊น์?"+description: "์์ ์ ๋ง๋ Fetcher ๋๋ StealthyFetcher๋ฅผ ์ ํํ์ธ์. ์ง์ HTTP ์์ฒญ, JavaScript ์คํ, ์ธ์ ์ฌ์ฌ์ฉ์ด ํ์ํ ๊ฒฝ์ฐ๋ฅผ ์์๋ด ๋๋ค."+---++# Fetcher ๊ธฐ์ด {#fetchers-basics}++## ์๊ฐ {#introduction}+Fetcher๋ ํ ์ค๋ก ์์ฒญ์ ๋ณด๋ด๊ฑฐ๋ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ณ [Response](#response-object) ๊ฐ์ฒด๋ฅผ ๋ฐํํ๋ ํด๋์ค์ ๋๋ค. ๋ค์ํ ๊ธฐ๋ฅ๋ ์ ๊ณตํฉ๋๋ค. v0.3๋ถํฐ ๋ชจ๋ Fetcher์๋ ์ธ์ ์ ์ ์งํ๋ ๋ณ๋ ํด๋์ค๊ฐ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ๋ธ๋ผ์ฐ์ Fetcher๋ ์์ฒญ๋ง๋ค ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ฌ๋ ๋์ ๋ชจ๋ ์์ฒญ์ด ๋๋ ๋๊น์ง ๊ฐ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ด์ด๋ ์ ์์ต๋๋ค. ์์ ์ ๋ง๊ฒ ์ ํํ๋ฉด ๋ฉ๋๋ค.++v0.2 ์ด์ ์ Scrapling์ ํ์ฑ๋ง ์ ๊ณตํ์ต๋๋ค. ์น ์คํฌ๋ํ์ ํ์ํ ๋ชจ๋ ๊ธฐ๋ฅ์ ํ๊ณณ์์ ์ ๊ณตํ๊ธฐ ์ํด ์ด ๊ธฐ๋ฅ๋ค์ ์ถ๊ฐํ์ต๋๋ค.++> Fetcher๋ ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋จ์ํ ๊ฐ์ผ ๋๊ตฌ๊ฐ ์๋๋๋ค. ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์์ฒญ๊ณผ ํ์ด์ง ๋ก๋ฉ์ ์ํ ์์ง์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ๊ฐ Fetcher๋ ํด๋น ์์ง์ ์๋ ๊ธฐ๋ฅ์ ์ถ๊ฐํ๋ฉด์ ์์ง์ ๊ธฐ๋ฅ์ ํ์ฉํ๊ณ ์น ์คํฌ๋ํ์ ๋ง๊ฒ ์ต์ ํํฉ๋๋ค.++## Fetcher ๋น๊ต {#fetchers-overview}++Scrapling์ HTTP์ฉ `Fetcher`์ `AsyncFetcher`, ๋ธ๋ผ์ฐ์ ์ฉ `StealthyFetcher`, ๊ทธ๋ฆฌ๊ณ ๋ฐ๋ณต ์์ฒญ์ ์ฐ๋ ์ธ์ ํด๋์ค๋ฅผ ์ ๊ณตํฉ๋๋ค.++๋ค์ ํ๋ฅผ ๋ณด๋ฉด ์์ ์ ๋ง๋ Fetcher๋ฅผ ๋น ๋ฅด๊ฒ ์ ํํ ์ ์์ต๋๋ค.+++| ๊ธฐ๋ฅ | Fetcher | StealthyFetcher |+|--------------------|---------------------------------------------------|--------------------------------------------------------------------------------------------|+| ์๋์ ์ธ ์๋ | ๐๐๐๐๐ | ๐๐๐ |+| ํ์ง ํํผ | โญโญ | โญโญโญโญโญ |+| ๋ด ์ฐจ๋จ ์ฐํ ์ต์ | โญโญ | โญโญโญโญโญ |+| JavaScript ๋ก๋ฉ | โ | โ |+| ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ | โญ | โญโญโญ |+| ์ ํฉํ ์์ | HTTP ์์ฒญ๋ง์ผ๋ก ๊ฐ๋ฅํ ๊ธฐ๋ณธ์ ์ธ ์คํฌ๋ํ | - ๋์ ์ผ๋ก ๋ก๋๋๋ ์ฌ์ดํธ <br/>- ๊ฐ๋จํ ์๋ํ <br/>- ๋จ์ํ ๋ณดํธ๋ถํฐ ๋ณต์กํ ๋ณดํธ๊น์ง ์ฐํ |+| ๋ธ๋ผ์ฐ์ | โ | Chromium๊ณผ Google Chrome |+| ์ฌ์ฉํ๋ ๋ธ๋ผ์ฐ์ API | โ | Playwright |+| ์ค์ ๋์ด๋ | ์ฌ์ | ์ฌ์ |++๋ค์ ํ์ด์ง๋ถํฐ ๊ฐ๊ฐ ์์ธํ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++## ๋ชจ๋ Fetcher์ ํ์ ์ค์ {#parser-configuration-in-all-fetchers}+๋ชจ๋ Fetcher๋ ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๊ฐ์ ธ์ต๋๋ค.+```python+from scrapling.fetchers import Fetcher, AsyncFetcher, StealthyFetcher+```+๊ฐ์ฒด๋ฅผ ๋ง๋ค์ง ์๊ณ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, ํ์์ ๊ธฐ๋ณธ ์ค์ ์ ์ฌ์ฉํฉ๋๋ค.+```python+page = StealthyFetcher.fetch('https://example.com')+```+์๋ต์ ๋ฐํํ๊ธฐ ์ ์ ์ ์ฉํ ํ์([Selector ํด๋์ค](../parsing/main_classes.md#selector))๋ฅผ ์ค์ ํ๋ ค๋ฉด ๋จผ์ ๋ค์์ ์คํํ์ธ์.+```python+from scrapling.fetchers import Fetcher+Fetcher.configure(adaptive=True, keep_comments=False) # and the rest+```+๋๋ ๋ค์์ฒ๋ผ ์์ฑํฉ๋๋ค.+```python+from scrapling.fetchers import Fetcher+Fetcher.adaptive=True+Fetcher.keep_comments=False+```+๊ทธ๋ฐ ๋ค์ ํ์์ฒ๋ผ ์ฝ๋๋ฅผ ์ด์ด์ ์์ฑํ๋ฉด ๋ฉ๋๋ค.++์ค์ ํ ์ ์๋ ์ธ์๋ `adaptive`, `adaptive_domain`, `huge_tree`, `keep_comments`, `storage`, `storage_args`์ ๋๋ค. [Selector](../parsing/main_classes.md#selector) ํด๋์ค์ ์ ๋ฌํ๋ ๊ฒ๊ณผ ๊ฐ์ต๋๋ค. `<fetcher_class>.display_config()`๋ก ํ์ฌ ์ค์ ์ ์ธ์ ๋ ํ์ธํ ์ ์์ต๋๋ค.++!!! info "์ ๋ณด"++ `adaptive`๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค. ์ ์ํ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด ์ผ์ผ ํฉ๋๋ค.++### ์์ฒญ๋ณ ํ์ ์ค์ {#set-parser-config-per-request}+์์ ํ์ ์ค์ ์ ํด๋น ํด๋์ค๋ฅผ ํตํด ๋ณด๋ด๋ ๋ชจ๋ ์์ฒญ์ ์ ์ฉ๋ฉ๋๋ค. ๊ณตํต ์ค์ ์ ๊ฐ๋จํ ์ง์ ํ ๋ ์ฌ์ฉํฉ๋๋ค.++์์ฒญ๋ง๋ค ๋ค๋ฅธ ์ค์ ์ด ํ์ํ๋ฉด ์์ฒญ ๋ฉ์๋(`fetch`/`get`/`post`/...)์ `selector_config` ์ธ์์ ๋์ ๋๋ฆฌ๋ฅผ ์ ๋ฌํ์ธ์.++## Response ๊ฐ์ฒด {#response-object}+`Response`๋ [Selector](../parsing/main_classes.md#selector)๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ฉฐ, ์๋ต ํค๋, ์ํ, ์ฟ ํค ๋ฑ ์ถ๊ฐ ์ ๋ณด๋ ์ ๊ณตํฉ๋๋ค.+```python+from scrapling.fetchers import Fetcher+page = Fetcher.get('https://example.com')++page.status # HTTP status code+page.reason # Status message+page.cookies # Response cookies as a dictionary+page.headers # Response headers+page.request_headers # Request headers+page.history # Response history of redirections, if any+page.body # Raw response body as bytes+page.encoding # Response encoding+page.meta # Response metadata dictionary (e.g., proxy used). Mainly helpful with the spiders system.+```+๋ชจ๋ Fetcher๋ `Response` ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค. `record_requests=True`๋ก ๋ง๋ ๋ธ๋ผ์ฐ์ ์ธ์ ์์๋ `session.network.search(limit=None)`๊ณผ `session.network.get(request_id)`๋ ์ ์ฅ๋ `Response` ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค. ์ ์ฅ๋ API ์๋ต๊ณผ v5๋ก์ ์ด์ ์ [๋คํธ์ํฌ ๊ธฐ๋ก](stealthy.md#network-history)์ ์ฐธ๊ณ ํ์ธ์.++`Response` ๊ฐ์ฒด๋ ํ ์ค๋ก ํ์ด์ง๋ฅผ ์ ๋ฆฌ๋ LLM์ฉ Markdown์ผ๋ก ๋ฐ๊ฟ ์๋ ์์ต๋๋ค.+```python+markdown = Fetcher.get('https://example.com').markdown(main_content_only=True)+```+๋ณํ ์ ์ ์คํฌ๋ฆฝํธ, ์คํ์ผ, ์จ๊ฒจ์ง ๋ด์ฉ๊ณผ ํ๋กฌํํธ ์ธ์ ์ ๋ด์ฉ์ ํญ์ ์ ๊ฑฐํฉ๋๋ค. `css_selector`๋ก ํน์ ์์๋ง ๋ณํํ ์๋ ์์ต๋๋ค. `rag` ์ถ๊ฐ ํจํค์ง๊ฐ ํ์ํ๋ฉฐ `ai`/`shell`/`all`์๋ ํฌํจ๋ฉ๋๋ค. ์์ธํ ์ค๋ช ์ [RAG ์์คํ ๋ง๋ค๊ธฐ](../ai/building-rag-systems.md)๋ฅผ ์ฐธ๊ณ ํ์ธ์.++!!! note "์ฐธ๊ณ "++ v0.4๋ถํฐ `Response`์ ๋ณธ๋ฌธ์ [Selector](../parsing/main_classes.md#selector)์ ๋ฌ๋ฆฌ ํญ์ ๋ฐ์ดํธ์ ๋๋ค.diff --git a/docs/locales/ko/fetching/static.md b/docs/locales/ko/fetching/static.mdnew file mode 100644index 0000000..762663a--- /dev/null+++ b/docs/locales/ko/fetching/static.md@@ -0,0 +1,449 @@+---+title: "Fetcher์ FetcherSession์ผ๋ก Python์์ HTTP ์คํฌ๋ํํ๊ธฐ"+description: "๋ธ๋ผ์ฐ์ ๋ชจ๋ฐฉ, ์ฟ ํค, ํ๋ก์, ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ ์ธ์ ์ผ๋ก ๋๊ธฐ ๋ฐ ๋น๋๊ธฐ HTTP ์์ฒญ์ ๋ณด๋ด๊ณ Scrapling์ผ๋ก ์๋ต์์ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ์ธ์."+---++# HTTP ์์ฒญ {#http-requests}++`Fetcher`๋ ๊ณ ์ฑ๋ฅ ๋ผ์ด๋ธ๋ฌ๋ฆฌ `curl_cffi`๋ฅผ ์ฌ์ฉํด ๋น ๋ฅด๊ณ ๊ฐ๋ฒผ์ด HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ํ์ง๋ฅผ ํผํ๋ ๊ธฐ๋ฅ๋ ๋ค์ํ๊ฒ ์ ๊ณตํฉ๋๋ค.++!!! success "์ฌ์ ์ค๋น"++ 1. [Fetcher ๊ธฐ์ด](../fetching/choosing.md)๋ฅผ ์ฝ๊ณ [Response ๊ฐ์ฒด](../fetching/choosing.md#response-object)์ Fetcher๋ฅผ ๊ณ ๋ฅด๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 2. [์์ ์ฐพ๊ธฐ](../parsing/selection.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector)/[Response](../fetching/choosing.md#response-object)์์ ์์๋ฅผ ์ฐพ๊ณ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 3. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Response](../fetching/choosing.md#response-object)๊ฐ [Selector](../parsing/main_classes.md#selector)์์ ์์ํ๋ ์์ฑ๊ณผ ๋ฉ์๋๋ฅผ ์์๋์ธ์.++## ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ {#basic-usage}+์ด Fetcher๋ฅผ ๊ฐ์ ธ์ค๋ ๊ธฐ๋ณธ ๋ฐฉ๋ฒ์ ๋ค๋ฅธ Fetcher์ ๊ฐ์ต๋๋ค.++```python+from scrapling.fetchers import Fetcher+```+ํ์ ์ค์ ๋ฐฉ๋ฒ์ [์ฌ๊ธฐ](choosing.md#parser-configuration-in-all-fetchers)๋ฅผ ์ฐธ๊ณ ํ์ธ์.++### ๊ณตํต ์ธ์ {#shared-arguments}+๋ชจ๋ ์์ฒญ ๋ฉ์๋์์ ์ฌ์ฉํ๋ ๊ณตํต ์ธ์๋ถํฐ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++- **url**: ๋์ URL์ ๋๋ค.+- **stealthy_headers**: ์ผ๋ฉด ์ค์ ๋ธ๋ผ์ฐ์ ์ ํค๋๋ฅผ ์์ฑํด ์ถ๊ฐํฉ๋๋ค. Google Referer ํค๋๋ ์ค์ ํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.+- **follow_redirects**: ๋ฆฌ๋๋ ์ ์ ์ ์ดํฉ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ `"safe"`**์ ๋๋ค. ๋ฆฌ๋๋ ์ ์ ๋ฐ๋ฅด๋ ๋ด๋ถ ๋๋ ์ฌ์ค IP๋ก ๊ฐ๋ ๋ฆฌ๋๋ ์ ์ ์ฐจ๋จํด SSRF๋ฅผ ๋ฐฉ์งํฉ๋๋ค. `True`๋ ์ ํ ์์ด ๋ชจ๋ ๋ฐ๋ฅด๊ณ , `False`๋ ๋ฆฌ๋๋ ์ ์ ๋ชจ๋ ๋๋๋ค.+- **timeout**: ๊ฐ ์์ฒญ์ ์๋ฃ๋ฅผ ๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ์ ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ 30์ด**์ ๋๋ค.+- **retries**: ์คํจํ ์์ฒญ์ ์ต๋ ์๋ ํ์์ด๋ฉฐ ์ฒซ ๋ฒ์งธ ์๋๋ ํฌํจํฉ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ 3**์ ๋๋ค.+- **retry_delay**: ์ฌ์๋ ์ฌ์ด์ ๊ธฐ๋ค๋ฆฌ๋ ์ด ๋จ์ ์๊ฐ์ ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ 1์ด**์ ๋๋ค.+- **impersonate**: ํน์ ๋ธ๋ผ์ฐ์ ์ TLS ์ง๋ฌธ์ ๋ชจ๋ฐฉํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ๋ฌธ์์ด ๋๋ ๋ฌธ์์ด ๋ฆฌ์คํธ๋ฅผ ๋ฐ์ต๋๋ค. `"chrome110"`, `"firefox102"`, `"safari15_5"`๋ ํน์ ๋ฒ์ ์ ์ฌ์ฉํ๊ณ , `"chrome"`, `"firefox"`, `"safari"`, `"edge"`๋ ์ฌ์ฉ ๊ฐ๋ฅํ ์ต์ ๋ฒ์ ์ ์ฌ์ฉํฉ๋๋ค. TLS ์์ค์์ ์ค์ ๋ธ๋ผ์ฐ์ ์ ์์ฒญ์ฒ๋ผ ๋ณด์ด๊ฒ ํฉ๋๋ค. ๋ฆฌ์คํธ๋ฅผ ์ ๋ฌํ๋ฉด ์์ฒญ๋ง๋ค ๋ฌด์์๋ก ํ๋๋ฅผ ์ ํํฉ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ ์ฌ์ฉ ๊ฐ๋ฅํ ์ต์ Chrome ๋ฒ์ ์ ๋๋ค.**+- **http3**: HTTP/3์ ์ฌ์ฉํฉ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ False**์ ๋๋ค. `impersonate`์ ํจ๊ป ์ฌ์ฉํ๋ฉด ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์์ต๋๋ค.+- **cookies**: ์์ฒญ์ ์ฌ์ฉํ ์ฟ ํค์ ๋๋ค. `nameโvalue` ๋์ ๋๋ฆฌ ๋๋ ๋์ ๋๋ฆฌ ๋ฆฌ์คํธ๋ฅผ ๋ฐ์ต๋๋ค.+- **proxy**: ์์ฒญ์ HTTP ๋ฐ HTTPS ํธ๋ํฝ์ ๋ณด๋ผ ํ๋ก์์ ๋๋ค. ํ์์ `http://username:password@localhost:8030`์ ๋๋ค.+- **proxy_auth**: ํ๋ก์์ HTTP Basic ์ธ์ฆ์ ๋๋ค. (username, password) ํํ๋ก ์ ๋ฌํฉ๋๋ค.+- **proxies**: ์ฌ์ฉํ ํ๋ก์ ๋์ ๋๋ฆฌ์ ๋๋ค. ํ์์ `{"http": proxy_url, "https": proxy_url}`์ ๋๋ค.+- **proxy_rotator**: ์๋ ํ๋ก์ ์ํ์ ์ฌ์ฉํ `ProxyRotator` ๊ฐ์ฒด์ ๋๋ค. `proxy` ๋๋ `proxies`์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.+- **headers**: ์์ฒญ์ ํฌํจํ ํค๋์ ๋๋ค. `stealthy_headers`๊ฐ ์์ฑํ ํค๋๋ฅผ ๋ฎ์ด์ธ ์ ์์ต๋๋ค.+- **max_redirects**: ์ต๋ ๋ฆฌ๋๋ ์ ํ์์ ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ 30**์ด๋ฉฐ, -1์ ์ ํ์ ์์ฑ๋๋ค.+- **verify**: HTTPS ์ธ์ฆ์๋ฅผ ๊ฒ์ฆํ ์ง ์ ํฉ๋๋ค. **๊ธฐ๋ณธ๊ฐ์ True**์ ๋๋ค.+- **cert**: ํด๋ผ์ด์ธํธ ์ธ์ฆ์ ํ์ผ ์ด๋ฆ์ (cert, key) ํํ์ ๋๋ค.+- **selector_config**: ์ต์ข `Selector`/`Response` ๊ฐ์ฒด๋ฅผ ๋ง๋ค ๋ ์ฌ์ฉํ ํ์ ์ค์ ๋์ ๋๋ฆฌ์ ๋๋ค.++!!! note "์ฐธ๊ณ "++ 1. ํ์ฌ ๋ชจ๋ฐฉํ ์ ์๋ ๋ธ๋ผ์ฐ์ ๋ `"edge"`, `"chrome"`, `"chrome_android"`, `"safari"`, `"safari_beta"`, `"safari_ios"`, `"safari_ios_beta"`, `"firefox"`, `"tor"`์ ๋๋ค.<br/>+ 2. ๋ธ๋ผ์ฐ์ ์ ๋ฒ์ ๋ชฉ๋ก์ ์ธ์ ์๋ ์์ฑ์ ํ์๋๋ฉฐ `curl_cffi`๊ฐ ์ ๋ฐ์ดํธ๋ ๋ ํจ๊ป ๊ฐฑ์ ๋ฉ๋๋ค.<br/>+ 3. `impersonate` ๋๋ `stealthy_headers`๊ฐ ์ผ์ ธ ์์ผ๋ฉด Fetcher๊ฐ ํด๋น ๋ธ๋ผ์ฐ์ ๋ฒ์ ์ ๋ง๋ ์ค์ ํค๋๋ฅผ ์๋ ์์ฑํฉ๋๋ค.++๋ ์ธ๋ฐํ๊ฒ ์ค์ ํ๋ ค๋ฉด ๊ฐ ๋ฉ์๋๊ฐ ์ง์ ์ง์ํ์ง ์๋ ์ธ์๋ ์ ๋ฌํ ์ ์์ต๋๋ค. `curl_cffi`๊ฐ ์ง์ํ๋ ์ธ์์ฌ์ผ ํฉ๋๋ค.++### ํ ์คํธ ์ธ์ฝ๋ฉ {#text-encoding}++UTF-8์ด ์๋ ํ์ด์ง์์ ๊ธ์๊ฐ ๊นจ์ง๋ฉด ์์ฒญ์ `default_encoding="shift_jis"` ๋๋ ํด๋น ํ์ด์ง์ ์ธ์ฝ๋ฉ์ ์ ๋ฌํ์ธ์. `Content-Type`์ charset์ด ์์ ๋ ์ฌ์ฉํ ๋์ฒด ์ธ์ฝ๋ฉ์ ์ค์ ํฉ๋๋ค. ์๋ฒ๊ฐ ์ง์ ํ charset์ ๋ฎ์ด์ฐ์ง๋ ์์ต๋๋ค.++์๋ฒ๊ฐ ์๋ชป๋ charset์ ๋ณด๋๋ค๋ฉด `selector_config={"encoding": "shift_jis"}`๋ก ์ฌ๋ฐ๋ฅธ ์ธ์ฝ๋ฉ์ ๊ฐ์ ํ ์ ์์ต๋๋ค.++### HTTP ๋ฉ์๋ {#http-methods}+๋ฉ์๋๋ง๋ค ์ถ๊ฐ ์ธ์๊ฐ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด GET์ `params`, POST/PUT/DELETE๋ `data`/`json`์ ๋ฐ์ต๋๋ค.++์์ ๋ก ์ดํด๋ณด๊ฒ ์ต๋๋ค.++> `OPTIONS`์ `HEAD` ๋ฉ์๋๋ ์ง์ํ์ง ์์ต๋๋ค.+#### GET {#get}+```python+from scrapling.fetchers import Fetcher+# Basic GET+page = Fetcher.get('https://example.com')+page = Fetcher.get('https://scrapling.requestcatcher.com/get', stealthy_headers=True)+page = Fetcher.get('https://scrapling.requestcatcher.com/get', proxy='http://username:password@localhost:8030')+# With parameters+page = Fetcher.get('https://example.com/search', params={'q': 'query'})++# With headers+page = Fetcher.get('https://example.com', headers={'User-Agent': 'Custom/1.0'})+# Basic HTTP authentication+page = Fetcher.get("https://example.com", auth=("my_user", "password123"))+# Browser impersonation+page = Fetcher.get('https://example.com', impersonate='chrome')+# HTTP/3 support+page = Fetcher.get('https://example.com', http3=True)+```+๋น๋๊ธฐ ์์ฒญ์๋ ์กฐ๊ธ๋ง ๋ฐ๊พธ๋ฉด ๋ฉ๋๋ค.+```python+from scrapling.fetchers import AsyncFetcher+# Basic GET+page = await AsyncFetcher.get('https://example.com')+page = await AsyncFetcher.get('https://scrapling.requestcatcher.com/get', stealthy_headers=True)+page = await AsyncFetcher.get('https://scrapling.requestcatcher.com/get', proxy='http://username:password@localhost:8030')+# With parameters+page = await AsyncFetcher.get('https://example.com/search', params={'q': 'query'})+# With headers+page = await AsyncFetcher.get('https://example.com', headers={'User-Agent': 'Custom/1.0'})+# Basic HTTP authentication+page = await AsyncFetcher.get("https://example.com", auth=("my_user", "password123"))+# Browser impersonation+page = await AsyncFetcher.get('https://example.com', impersonate='chrome110')+# HTTP/3 support+page = await AsyncFetcher.get('https://example.com', http3=True)+```+๋ชจ๋ ๊ฒฝ์ฐ์ `page`๋ [Response](choosing.md#response-object) ๊ฐ์ฒด์ ๋๋ค. [Selector](../parsing/main_classes.md#selector)๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ฏ๋ก ๋ฐ๋ก ํ์ฑ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+```python+page.css('.something.something')++page = Fetcher.get('https://api.github.com/events')+>>> page.json()+[{'id': '<redacted>',+ 'type': 'PushEvent',+ 'actor': {'id': '<redacted>',+ 'login': '<redacted>',+ 'display_login': '<redacted>',+ 'gravatar_id': '',+ 'url': 'https://api.github.com/users/<redacted>',+ 'avatar_url': 'https://avatars.githubusercontent.com/u/<redacted>'},+ 'repo': {'id': '<redacted>',+...+```+#### POST {#post}+```python+from scrapling.fetchers import Fetcher+# Basic POST+page = Fetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, params={'q': 'query'})+page = Fetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, stealthy_headers=True)+page = Fetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, proxy='http://username:password@localhost:8030', impersonate="chrome")+# Another example of form-encoded data+page = Fetcher.post('https://example.com/submit', data={'username': 'user', 'password': 'pass'}, http3=True)+# JSON data+page = Fetcher.post('https://example.com/api', json={'key': 'value'})+```+๋น๋๊ธฐ ์์ฒญ์๋ ์กฐ๊ธ๋ง ๋ฐ๊พธ๋ฉด ๋ฉ๋๋ค.+```python+from scrapling.fetchers import AsyncFetcher+# Basic POST+page = await AsyncFetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'})+page = await AsyncFetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, stealthy_headers=True)+page = await AsyncFetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, proxy='http://username:password@localhost:8030', impersonate="chrome")+# Another example of form-encoded data+page = await AsyncFetcher.post('https://example.com/submit', data={'username': 'user', 'password': 'pass'}, http3=True)+# JSON data+page = await AsyncFetcher.post('https://example.com/api', json={'key': 'value'})+```+#### PUT {#put}+```python+from scrapling.fetchers import Fetcher+# Basic PUT+page = Fetcher.put('https://example.com/update', data={'status': 'updated'})+page = Fetcher.put('https://example.com/update', data={'status': 'updated'}, stealthy_headers=True, impersonate="chrome")+page = Fetcher.put('https://example.com/update', data={'status': 'updated'}, proxy='http://username:password@localhost:8030')+# Another example of form-encoded data+page = Fetcher.put("https://scrapling.requestcatcher.com/put", data={'key': ['value1', 'value2']})+```+๋น๋๊ธฐ ์์ฒญ์๋ ์กฐ๊ธ๋ง ๋ฐ๊พธ๋ฉด ๋ฉ๋๋ค.+```python+from scrapling.fetchers import AsyncFetcher+# Basic PUT+page = await AsyncFetcher.put('https://example.com/update', data={'status': 'updated'})+page = await AsyncFetcher.put('https://example.com/update', data={'status': 'updated'}, stealthy_headers=True, impersonate="chrome")+page = await AsyncFetcher.put('https://example.com/update', data={'status': 'updated'}, proxy='http://username:password@localhost:8030')+# Another example of form-encoded data+page = await AsyncFetcher.put("https://scrapling.requestcatcher.com/put", data={'key': ['value1', 'value2']})+```++#### DELETE {#delete}+```python+from scrapling.fetchers import Fetcher+page = Fetcher.delete('https://example.com/resource/123')+page = Fetcher.delete('https://example.com/resource/123', stealthy_headers=True, impersonate="chrome")+page = Fetcher.delete('https://example.com/resource/123', proxy='http://username:password@localhost:8030')+```+๋น๋๊ธฐ ์์ฒญ์๋ ์กฐ๊ธ๋ง ๋ฐ๊พธ๋ฉด ๋ฉ๋๋ค.+```python+from scrapling.fetchers import AsyncFetcher+page = await AsyncFetcher.delete('https://example.com/resource/123')+page = await AsyncFetcher.delete('https://example.com/resource/123', stealthy_headers=True, impersonate="chrome")+page = await AsyncFetcher.delete('https://example.com/resource/123', proxy='http://username:password@localhost:8030')+```++## ์ธ์ ๊ด๋ฆฌ {#session-management}++๊ฐ์ ์ค์ ์ผ๋ก ์ฌ๋ฌ ์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด `FetcherSession`์ ์ฌ์ฉํ์ธ์. ๋๊ธฐ ์ฝ๋์ ๋น๋๊ธฐ ์ฝ๋ ๋ชจ๋์์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ํด๋์ค๊ฐ ์ธ์ ํ์ ์ ์๋์ผ๋ก ํ๋จํ๋ฏ๋ก ๋ค๋ฅธ ํด๋์ค๋ฅผ ๊ฐ์ ธ์ฌ ํ์๊ฐ ์์ต๋๋ค.++`FetcherSession`์ ์์ฒญ ๋ฉ์๋์ ์ธ์๋ฅผ ๊ฑฐ์ ๋ชจ๋ ๋ฐ์ต๋๋ค. ์ธ์ ์ ์ฒด์ ์ค์ ์ ์ง์ ํ ๋ค, ํน์ ์์ฒญ์์๋ง ๋ค๋ฅธ ์ค์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.++```python+from scrapling.fetchers import FetcherSession++# Create a session with default configuration+with FetcherSession(+ impersonate='chrome',+ http3=True,+ stealthy_headers=True,+ timeout=30,+ retries=3+) as session:+ # Make multiple requests with the same settings and the same cookies+ page1 = session.get('https://scrapling.requestcatcher.com/get')+ page2 = session.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'})+ page3 = session.get('https://api.github.com/events')++ # All requests share the same session and connection pool+```++`FetcherSession`์ `ProxyRotator`๋ฅผ ์ฌ์ฉํ๋ฉด ์์ฒญ ์ฌ์ด์ ํ๋ก์๋ฅผ ์๋์ผ๋ก ๋ฐ๊ฟ ์ ์์ต๋๋ค.++```python+from scrapling.fetchers import FetcherSession, ProxyRotator++rotator = ProxyRotator([+ 'http://proxy1:8080',+ 'http://proxy2:8080',+ 'http://proxy3:8080',+])++with FetcherSession(proxy_rotator=rotator, impersonate='chrome') as session:+ # Each request automatically uses the next proxy in rotation+ page1 = session.get('https://example.com/page1')+ page2 = session.get('https://example.com/page2')++ # You can check which proxy was used via the response metadata+ print(page1.meta['proxy'])+```++์์ฒญ ๋ฉ์๋์ `proxy=`๋ฅผ ์ง์ ์ ๋ฌํ๋ฉด ํด๋น ์์ฒญ์์ ์ธ์ ์ ํ๋ก์๋ ์ํ ์ค์ ์ ๋ฎ์ด์ธ ์ ์์ต๋๋ค.++```python+with FetcherSession(proxy='http://default-proxy:8080') as session:+ # Uses the session proxy+ page1 = session.get('https://example.com/page1')++ # Override the proxy for this specific request+ page2 = session.get('https://example.com/page2', proxy='http://special-proxy:9090')+```++๋น๋๊ธฐ ์์ ์ ๋๋ค.++```python+async with FetcherSession(impersonate='firefox', http3=True) as session:+ # All standard HTTP methods available+ response = await session.get('https://example.com')+ response = await session.post('https://scrapling.requestcatcher.com/post', json={'data': 'value'})+ response = await session.put('https://scrapling.requestcatcher.com/put', data={'update': 'info'})+ response = await session.delete('https://scrapling.requestcatcher.com/delete')+```+๋ ์ข์ ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.+```python+import asyncio+from scrapling.fetchers import FetcherSession++# Async session usage+async with FetcherSession(impersonate="safari") as session:+ urls = ['https://example.com/page1', 'https://example.com/page2']++ tasks = [+ session.get(url) for url in urls+ ]++ pages = await asyncio.gather(*tasks)+```++`Fetcher`๋ ์์ฒญ๋ง๋ค `FetcherSession`์ผ๋ก ์์ ์ธ์ ์ ๋ง๋ญ๋๋ค.++### ์ธ์ ์ ์ฅ์ {#session-benefits}++- **๋ ๋น ๋ฅธ ์๋**: ์์ฒญ๋ง๋ค ์ ์ธ์ ์ ๋ง๋๋ ๊ฒ๋ณด๋ค 10๋ฐฐ ๋น ๋ฆ ๋๋ค.+- **์ฟ ํค ์ ์ง**: ์์ฒญ ์ฌ์ด์ ์ฟ ํค๋ฅผ ์๋์ผ๋ก ๊ด๋ฆฌํฉ๋๋ค.+- **๋ฆฌ์์ค ์ ์ฝ**: ์ฌ๋ฌ ์์ฒญ์์ ๋ฉ๋ชจ๋ฆฌ์ CPU๋ฅผ ๋ ํจ์จ์ ์ผ๋ก ์ฌ์ฉํฉ๋๋ค.+- **์ค์ ํตํฉ**: ์์ฒญ ์ค์ ์ ํ๊ณณ์์ ๊ด๋ฆฌํฉ๋๋ค.++## ์์ {#examples}+์น ์คํฌ๋ํ์ ์ฒ์ ์์ํ๋ ๋ถ๋ค์ ์ํ ์ ์ฒด ์์ ์ ๋๋ค.++### ๊ธฐ๋ณธ HTTP ์์ฒญ {#basic-http-request}++```python+from scrapling.fetchers import Fetcher++# Make a request+page = Fetcher.get('https://example.com')++# Check the status+if page.status == 200:+ # Extract title+ title = page.css('title::text').get()+ print(f"Page title: {title}")++ # Extract all links+ links = page.css('a::attr(href)').getall()+ print(f"Found {len(links)} links")+```++### ์ํ ๋ฐ์ดํฐ ์์ง {#product-scraping}++```python+from scrapling.fetchers import Fetcher++def scrape_products():+ page = Fetcher.get('https://example.com/products')++ # Find all product elements+ products = page.css('.product')++ results = []+ for product in products:+ results.append({+ 'title': product.css('.title::text').get(),+ 'price': product.css('.price::text').re_first(r'\d+\.\d{2}'),+ 'description': product.css('.description::text').get(),+ 'in_stock': product.has_class('in-stock')+ })++ return results+```++### ํ์ผ ๋ค์ด๋ก๋ {#downloading-files}++```python+from scrapling.fetchers import Fetcher++page = Fetcher.get('https://raw.githubusercontent.com/D4Vinci/Scrapling/main/docs/assets/main_cover.png')+with open(file='main_cover.png', mode='wb') as f:+ f.write(page.body)+```++### ์ฌ๋ฌ ํ์ด์ง ์ฒ๋ฆฌ {#pagination-handling}++```python+from scrapling.fetchers import Fetcher++def scrape_all_pages():+ base_url = 'https://example.com/products?page={}'+ page_num = 1+ all_products = []++ while True:+ # Get current page+ page = Fetcher.get(base_url.format(page_num))++ # Find products+ products = page.css('.product')+ if not products:+ break++ # Process products+ for product in products:+ all_products.append({+ 'name': product.css('.name::text').get(),+ 'price': product.css('.price::text').get()+ })++ # Next page+ page_num += 1++ return all_products+```++### ํผ ์ ์ถ {#form-submission}++```python+from scrapling.fetchers import Fetcher++# Submit login form+response = Fetcher.post(+ 'https://example.com/login',+ data={+ 'username': '[email protected]',+ 'password': 'password123'+ }+)++# Check login success+if response.status == 200:+ # Extract user info+ user_name = response.css('.user-name::text').get()+ print(f"Logged in as: {user_name}")+```++### ํ ์ถ์ถ {#table-extraction}++```python+from scrapling.fetchers import Fetcher++def extract_table():+ page = Fetcher.get('https://example.com/data')++ # Find table+ table = page.css('table')[0]++ # Extract headers+ headers = [+ th.text for th in table.css('thead th')+ ]++ # Extract rows+ rows = []+ for row in table.css('tbody tr'):+ cells = [td.text for td in row.css('td')]+ rows.append(dict(zip(headers, cells)))++ return rows+```++### ํ์ ๋ฉ๋ด {#navigation-menu}++```python+from scrapling.fetchers import Fetcher++def extract_menu():+ page = Fetcher.get('https://example.com')++ # Find navigation+ nav = page.css('nav')[0]++ menu = {}+ for item in nav.css('li'):+ links = item.css('a')+ if links:+ link = links[0]+ menu[link.text] = {+ 'url': link['href'],+ 'has_submenu': bool(item.css('.submenu'))+ }++ return menu+```++## ์ธ์ ์ฌ์ฉํ๋์? {#when-to-use}++๋ค์ ๊ฒฝ์ฐ์๋ `Fetcher`๋ฅผ ์ฌ์ฉํ์ธ์.++- ๋น ๋ฅธ HTTP ์์ฒญ์ด ํ์ํ ๋.+- ๋ฆฌ์์ค ์ฌ์ฉ๋์ ์ค์ด๊ณ ์ถ์ ๋.+- JavaScript ์คํ ์์ด ์์ฒญ๋ง์ผ๋ก ์ฌ์ดํธ๋ฅผ ์์งํ ์ ์์ ๋.+- ํ์ง ํํผ ๊ธฐ๋ฅ์ด ์ผ๋ถ ํ์ํ ๋. ์๋ฅผ ๋ค์ด ์ฌ์ดํธ์ ๋ณดํธ ๊ธฐ๋ฅ์ ์์ง๋ง JavaScript ๊ฒ์ฌ๋ ์์ ๋์ ๋๋ค.++๋ค์ ๊ฒฝ์ฐ์๋ `FetcherSession`์ ์ฌ์ฉํ์ธ์.++- ๊ฐ์ ์ฌ์ดํธ๋ ์ฌ๋ฌ ์ฌ์ดํธ์ ๋ฐ๋ณตํด์ ์์ฒญํ ๋.+- ์์ฒญ ์ฌ์ด์ ์ฟ ํค๋ ์ธ์ฆ ์ํ๋ฅผ ์ ์งํด์ผ ํ ๋.+- ์ฐ๊ฒฐ์ ์ฌ์ฌ์ฉํด ์๋๋ฅผ ๋์ด๊ณ ์ถ์ ๋.+- ์์ฒญ๋ง๋ค ๊ฐ์ ์ค์ ์ด ํ์ํ ๋.+- ์ธ์ ์ํ๊ฐ ํ์ํ API๋ฅผ ์ฌ์ฉํ ๋.++๋ค์ ๊ฒฝ์ฐ์๋ ๋ค๋ฅธ Fetcher๋ฅผ ์ฌ์ฉํ์ธ์.++- ๋ธ๋ผ์ฐ์ ์๋ํ๊ฐ ํ์ํ ๋.+- ๊ณ ๊ธ ๋ด ์ฐจ๋จ ์ฐํ๋ ํ์ง ํํผ ๊ธฐ๋ฅ์ด ํ์ํ ๋.+- JavaScript ์คํ์ด๋ ๋์ ์ฝํ ์ธ ์์ ์ํธ์์ฉ์ด ํ์ํ ๋.diff --git a/docs/locales/ko/fetching/stealthy.md b/docs/locales/ko/fetching/stealthy.mdnew file mode 100644index 0000000..b2f1397--- /dev/null+++ b/docs/locales/ko/fetching/stealthy.md@@ -0,0 +1,536 @@+---+title: "StealthyFetcher๋ก JavaScript ์ฌ์ดํธ ์คํฌ๋ํํ๊ธฐ"+description: "Scrapling ๋ธ๋ผ์ฐ์ ์ธ์ ์ผ๋ก ํ์ด์ง๋ฅผ ๋ ๋๋งํ๊ณ ๋ฐ์ดํฐ๋ฅผ ๊ธฐ๋ค๋ฆฌ๋ฉฐ ๋ก๊ทธ์ธ ์ํ์ ๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต์ ํ์ฉํ์ธ์. ํ๋ก์์ ๋ณด์ ๊ฒ์ฌ ์ฒ๋ฆฌ๋ ์ค์ ํ ์ ์์ต๋๋ค."+---++# StealthyFetcher๋ก ๋ธ๋ผ์ฐ์ ์์ ๊ฐ์ ธ์ค๊ธฐ {#browser-fetching-with-stealthyfetcher}++`StealthyFetcher`๋ JavaScript ํ์ด์ง๋ฅผ ๋ก๋ํ๊ณ ๋ด ์ฐจ๋จ ์ฐํ ๊ธฐ๋ฅ์ผ๋ก Chromium์ด๋ Google Chrome์ ์๋ํํฉ๋๋ค. ํ์ง๋ฅผ ํผํ๋๋ก ์์ ํ [Playwright API](https://playwright.dev/python/docs/intro)๋ฅผ ์ฌ์ฉํฉ๋๋ค.++๋ค์์ ์ค๋ช ํ ํ์ด์ง ์๋ํ์๋ [Playwright์ Page API](https://playwright.dev/python/docs/api/class-page)์ ๋ํ ๊ธฐ๋ณธ ์ง์์ด ํ์ํฉ๋๋ค.++!!! success "์ฌ์ ์ค๋น"++ 1. [Fetcher ๊ธฐ์ด](../fetching/choosing.md)๋ฅผ ์ฝ๊ณ [Response ๊ฐ์ฒด](../fetching/choosing.md#response-object)์ Fetcher๋ฅผ ๊ณ ๋ฅด๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 2. [์์ ์ฐพ๊ธฐ](../parsing/selection.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector)/[Response](../fetching/choosing.md#response-object)์์ ์์๋ฅผ ์ฐพ๊ณ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 3. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Response](../fetching/choosing.md#response-object)๊ฐ [Selector](../parsing/main_classes.md#selector)์์ ์์ํ๋ ์์ฑ๊ณผ ๋ฉ์๋๋ฅผ ์์๋์ธ์.++## ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ {#basic-usage}+์ด Fetcher๋ฅผ ๊ฐ์ ธ์ค๋ ๊ธฐ๋ณธ ๋ฐฉ๋ฒ์ ๋ค๋ฅธ Fetcher์ ๊ฐ์ต๋๋ค.++```python+from scrapling.fetchers import StealthyFetcher+```+ํ์ ์ค์ ๋ฐฉ๋ฒ์ [์ฌ๊ธฐ](choosing.md#parser-configuration-in-all-fetchers)๋ฅผ ์ฐธ๊ณ ํ์ธ์.++์ด์ ์ฃผ์ ์ธ์๋ฅผ ์์ ์ ํจ๊ป ํ๋์ฉ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ์ ์ฒด ์ธ์๋ฅผ ๋น ๋ฅด๊ฒ ํ์ธํ๋ ค๋ฉด [ํ๋ก ๋ฐ๋ก ์ด๋](#full-list-of-arguments)ํ์ธ์.++!!! abstract "์์ฝ"++ `fetch`์ ๋น๋๊ธฐ ๋ฒ์ ์ `async_fetch`์ ๋๋ค.+++ํ์ฌ ์ด Fetcher์๋ ์ธ ๊ฐ์ง ์ฃผ์ ์คํ ๋ฐฉ๋ฒ์ด ์์ผ๋ฉฐ ํ์์ ๋ฐ๋ผ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.++๋ค์ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค.++### 1. ํจ๊ป ์ ๊ณต๋๋ Chromium {#1-bundled-chromium}+```python+StealthyFetcher.fetch('https://example.com')+```+๊ธฐ๋ณธ ์คํ ์ค ์ค์ ์ผ๋ก ํจ๊ป ์ ๊ณต๋๋ Chromium์ ์ด๊ณ ํ์ด์ง๋ฅผ ๋ก๋ํฉ๋๋ค.++### 2. ์ค์น๋ Chrome {#2-real-chrome}+```python+StealthyFetcher.fetch('https://example.com', real_chrome=True)+```+Google Chrome์ด ์ค์น๋์ด ์๋ค๋ฉด ์ด ์ต์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ฒซ ๋ฒ์งธ ๋ฐฉ๋ฒ๊ณผ ๊ฐ์ง๋ง Chromium ๋์ ๊ธฐ๊ธฐ์ ์ค์น๋ Google Chrome์ ์ฌ์ฉํฉ๋๋ค. ์์ฒญ์ด ์ผ๋ฐ ๋ธ๋ผ์ฐ์ ์ ์์ฒญ์ ๋ ๊ฐ๊น์์ ธ ํ์ง๋ ๊ฐ๋ฅ์ฑ์ด ์ค์ด๋ญ๋๋ค.++Google Chrome์ ์์ง ์ค์นํ์ง ์์๋ค๋ฉด ์ง์ ์ค์นํ๋ ๋์ ๋ค์ ๋ช ๋ น์ผ๋ก ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ฌ์ฉํ Chrome์ ์ค์นํ ์ ์์ต๋๋ค.+```commandline+playwright install chrome+```++### 3. CDP ์ฐ๊ฒฐ {#3-cdp-connection}+```python+StealthyFetcher.fetch('https://example.com', cdp_url='ws://localhost:9222')+```+๋ก์ปฌ์์ Chromium์ด๋ Google Chrome์ ์คํํ๋ ๋์ [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/)๋ก ์๊ฒฉ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค.++URL์ ๋ธ๋ผ์ฐ์ ์๋น์ค๊ฐ ์ ๊ณตํ๋ WebSocket ์ฃผ์(`ws://`/`wss://`)๋ ๋ธ๋ผ์ฐ์ ์ HTTP ์ฃผ์(์: `http://localhost:9222`)์ผ ์ ์์ต๋๋ค.+++## ์ด๋ค ๊ธฐ๋ฅ์ด ์๋์? {#what-does-it-do}++StealthyFetcher๋ ๋ค์๊ณผ ๊ฐ์ ๋ด ์ฐจ๋จ ์ฐํ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.++1. `solve_cloudflare=True`๋ก ๋ชจ๋ ์ข ๋ฅ์ Cloudflare Turnstile/Interstitial ๊ฒ์ฌ๋ฅผ ์๋์ผ๋ก ํต๊ณผํฉ๋๋ค.+2. CDP ๋ฐํ์๊ณผ WebRTC๋ฅผ ํตํ ์ ๋ณด ์ ์ถ์ ๋ง์ต๋๋ค.+3. JavaScript ์คํ์ ๊ฒฉ๋ฆฌํ๊ณ ๋ง์ Playwright ์ง๋ฌธ์ ์ ๊ฑฐํ๋ฉฐ, ์๋ ค์ง ๋ด ํ๋์ ๋ฐ๋ฅธ ํ์ง๋ฅผ ํผํฉ๋๋ค.+4. Canvas์ ๋ ธ์ด์ฆ๋ฅผ ์ถ๊ฐํด Canvas๋ฅผ ํตํ ์ง๋ฌธ ์์ง์ ๋ง์ต๋๋ค.+5. ์ฐฝ ์๋ ๋ชจ๋๋ฅผ ํ์งํ๋ ์๋ ค์ง ๋ฐฉ๋ฒ์ ์๋์ผ๋ก ๋์ํฉ๋๋ค. ์๊ฐ๋ ๋ถ์ผ์น๋ฅผ ์ด์ฉํ ํ์ง๋ฅผ ๋ง๋ ์ต์ ๋ ์ ๊ณตํฉ๋๋ค.+6. ๊ทธ ๋ฐ์๋ ๋ณดํธ ๊ธฐ๋ฅ์ ๋์ํ๋ ์ฌ๋ฌ ์ต์ ์ด ์์ต๋๋ค.++## ์ ์ฒด ์ธ์ ๋ชฉ๋ก {#full-list-of-arguments}+์ด Fetcher์ ์ธ์ ํด๋์ค์๋ ๋ค์ํ ์ต์ ์ด ์์ต๋๋ค. [์์ ](#examples)๋ฅผ ๋ณด๊ธฐ ์ ์ ์ ์ฒด ์ธ์๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค.+++| ์ธ์ | ์ค๋ช | ์ ํ ์ฌํญ |+|:---------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|+| url | ๋์ URL์ ๋๋ค. | โ |+| headless | `True`๋ ์ฐฝ์ ํ์ํ์ง ์๋ ๋ชจ๋(**๊ธฐ๋ณธ๊ฐ**)๋ก ์คํํ๊ณ , `False`๋ ์ฐฝ์ ํ์ํฉ๋๋ค. | โ๏ธ |+| disable_resources | ๋ถํ์ํ ๋ฆฌ์์ค ์์ฒญ์ ๊ฑด๋๋ฐ์ด ์๋๋ฅผ ๋์ ๋๋ค. ๋์ ํ์ ์ `font`, `image`, `media`, `beacon`, `object`, `imageset`, `texttrack`, `websocket`, `csp_report`, `stylesheet`์ ๋๋ค. | โ๏ธ |+| cookies | ๋ค์ ์์ฒญ์ ์ฌ์ฉํ ์ฟ ํค๋ฅผ ์ค์ ํฉ๋๋ค. | โ๏ธ |+| useragent | ์ฌ์ฉํ User-Agent ๋ฌธ์์ด์ ๋๋ค. **์๋ตํ๋ฉด Fetcher๊ฐ ๊ฐ์ ๋ธ๋ผ์ฐ์ ์ ๋ฒ์ ์ ์ค์ User-Agent๋ฅผ ์์ฑํด ์ฌ์ฉํฉ๋๋ค.** | โ๏ธ |+| network_idle | ์ต์ 500๋ฐ๋ฆฌ์ด ๋์ ๋คํธ์ํฌ ์ฐ๊ฒฐ์ด ์์ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. | โ๏ธ |+| load_dom | ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ํ์ด์ง์ ๋ชจ๋ JavaScript๊ฐ ๋ก๋๋๊ณ ์คํ๋ ๋๊น์ง, ์ฆ `domcontentloaded` ์ํ๊ฐ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. | โ๏ธ |+| pierce_shadow | open ๋ชจ๋์ Shadow DOM ๋ด์ฉ์ ์๋ต HTML์ ํฌํจํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `False`์ ๋๋ค. ์ธ์ ์ ์ฒด์ ์ค์ ํ๊ฑฐ๋ ์์ฒญ๋ณ๋ก ๋ฎ์ด์ธ ์ ์์ต๋๋ค. | โ๏ธ |+| timeout | ํ์ด์ง์ ๋ชจ๋ ์์ ๊ณผ ๋๊ธฐ์ ์ฌ์ฉํ๋ ์ ํ ์๊ฐ์ ๋๋ค. ๋จ์๋ ๋ฐ๋ฆฌ์ด์ด๋ฉฐ ๊ธฐ๋ณธ๊ฐ์ 30,000๋ฐ๋ฆฌ์ด(30์ด)์ ๋๋ค. | โ๏ธ |+| wait | ๋ชจ๋ ์ฒ๋ฆฌ๊ฐ ๋๋ ๋ค ํ์ด์ง๋ฅผ ๋ซ๊ณ `Response`๋ฅผ ๋ฐํํ๊ธฐ ์ ์ ๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ์ ๋๋ค. ๋จ์๋ ๋ฐ๋ฆฌ์ด์ ๋๋ค. | โ๏ธ |+| page_action | ์๋ํ์ฉ ํจ์์ ๋๋ค. `page` ๊ฐ์ฒด๋ฅผ ๋ฐ๊ณ ํ์ด์ง ์ด๋ ํ ํ์ํ ์์ ์ ์คํํฉ๋๋ค. | โ๏ธ |+| page_setup | `page` ๊ฐ์ฒด๋ฅผ ๋ฐ๊ณ ํ์ด์ง ์ด๋ ์ ์ ์คํ๋๋ ํจ์์ ๋๋ค. ํ์ด์ง ๋ก๋ ์ ์ ํ์ํ ์ด๋ฒคํธ ๋ฆฌ์ค๋๋ ๋ผ์ฐํธ๋ฅผ ๋ฑ๋กํ ๋ ์ฌ์ฉํฉ๋๋ค. | โ๏ธ |+| wait_selector | ์ง์ ํ CSS ์ ํ์์ ์์๊ฐ ํน์ ์ํ๊ฐ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. | โ๏ธ |+| init_script | ์ด ์ธ์ ์ ๊ฐ ํ์ด์ง๊ฐ ์์ฑ๋ ๋ ์คํํ JavaScript ํ์ผ์ ์ ๋ ๊ฒฝ๋ก์ ๋๋ค. | โ๏ธ |+| wait_selector_state | `wait_selector`๋ก ์ง์ ํ ์์๊ฐ ์ด ์ํ๊ฐ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. _๊ธฐ๋ณธ ์ํ๋ `attached`์ ๋๋ค._ | โ๏ธ |+| google_search | ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. Scrapling์ด Google Referer ํค๋๋ฅผ ์ค์ ํฉ๋๋ค. | โ๏ธ |+| extra_headers | ์์ฒญ์ ์ถ๊ฐํ ํค๋์ ๋์ ๋๋ฆฌ์ ๋๋ค. _`google_search`์ ํจ๊ป ์ฌ์ฉํ๋ฉด ํด๋น ์ต์ ์ Referer๊ฐ ์ฌ๊ธฐ์ ์ค์ ํ Referer๋ณด๋ค ์ฐ์ ํฉ๋๋ค._ | โ๏ธ |+| proxy | ์์ฒญ์ ์ฌ์ฉํ ํ๋ก์์ ๋๋ค. ๋ฌธ์์ด ๋๋ 'server', 'username', 'password' ํค๋ง ์๋ ๋์ ๋๋ฆฌ๋ฅผ ๋ฐ์ต๋๋ค. | โ๏ธ |+| real_chrome | ๊ธฐ๊ธฐ์ Chrome์ด ์ค์น๋์ด ์๋ค๋ฉด ์ด ์ต์ ์ ์ผ์ ํด๋น ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ ์ ์์ต๋๋ค. | โ๏ธ |+| locale | `en-GB`, `de-DE` ๊ฐ์ ๋ก์บ์ ๋๋ค. `navigator.language`, ์์ฒญ์ `Accept-Language` ํค๋, ์ซ์์ ๋ ์ง ํ์ ํ์์ ์ํฅ์ ์ค๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ์์คํ ๋ก์บ์ ๋๋ค. | โ๏ธ |+| timezone_id | ๋ธ๋ผ์ฐ์ ์ ์๊ฐ๋๋ฅผ ๋ฐ๊ฟ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ์์คํ ์๊ฐ๋์ ๋๋ค. | โ๏ธ |+| cdp_url | ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๋์ ์ด CDP URL์ ์ฐ๊ฒฐํด ๋ธ๋ผ์ฐ์ ๋ฅผ ์ ์ดํฉ๋๋ค. | โ๏ธ |+| user_data_dir | ์ฟ ํค์ ๋ก์ปฌ ์คํ ๋ฆฌ์ง ๊ฐ์ ๋ธ๋ผ์ฐ์ ์ธ์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ์ฌ์ฉ์ ๋ฐ์ดํฐ ๋๋ ํฐ๋ฆฌ์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์์ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค. **์ธ์ ์์๋ง ์ฌ์ฉํ ์ ์์ต๋๋ค.** | โ๏ธ |+| extra_flags | ๋ธ๋ผ์ฐ์ ์์ ์ ์ ๋ฌํ ์ถ๊ฐ ํ๋๊ทธ ๋ฆฌ์คํธ์ ๋๋ค. | โ๏ธ |+| solve_cloudflare | ์ผ๋ฉด ๋ชจ๋ ์ข ๋ฅ์ Cloudflare Turnstile/Interstitial ๊ฒ์ฌ๋ฅผ ํต๊ณผํ ๋ค ์๋ต์ ๋ฐํํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `False`์ ๋๋ค. | โ๏ธ |+| block_webrtc | WebRTC์ ํ๋ก์ ์ค์ ์ ์ ์ฉํด ๋ก์ปฌ IP ์ฃผ์ ์ ์ถ์ ๋ง์ต๋๋ค. | โ๏ธ |+| hide_canvas | Canvas ์์ ์ ๋ฌด์์ ๋ ธ์ด์ฆ๋ฅผ ์ถ๊ฐํด ์ง๋ฌธ ์์ง์ ๋ง์ต๋๋ค. | โ๏ธ |+| allow_webgl | ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ๋๋ฉด WebGL๊ณผ WebGL 2.0์ ๋ชจ๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ง์ WAF๊ฐ WebGL ํ์ฑํ ์ฌ๋ถ๋ฅผ ํ์ธํ๋ฏ๋ก ๋๋ ๊ฒ์ ๊ถ์ฅํ์ง ์์ต๋๋ค. | โ๏ธ |+| additional_args | Playwright ์ปจํ ์คํธ์ ์ ๋ฌํ ์ถ๊ฐ ์ค์ ์ ๋๋ค. Scrapling์ ์ค์ ๋ณด๋ค ์ฐ์ ํฉ๋๋ค. | โ๏ธ |+| selector_config | ์ต์ข `Selector`/`Response` ๊ฐ์ฒด๋ฅผ ๋ง๋ค ๋ ์ฌ์ฉํ ํ์ ์ค์ ๋์ ๋๋ฆฌ์ ๋๋ค. | โ๏ธ |+| blocked_domains | ์์ฒญ์ ์ฐจ๋จํ ๋๋ฉ์ธ ์ด๋ฆ์ ์งํฉ์ ๋๋ค. ํ์ ๋๋ฉ์ธ๋ ์ผ์นํฉ๋๋ค. ์๋ฅผ ๋ค์ด `"example.com"`์ `"sub.example.com"`๋ ์ฐจ๋จํฉ๋๋ค. | โ๏ธ |+| block_ads | ์๋ ค์ง ๊ด๊ณ ๋ฐ ์ถ์ ๋๋ฉ์ธ ์ฝ 3,500๊ฐ์ ๋ํ ์์ฒญ์ ์ฐจ๋จํฉ๋๋ค. `blocked_domains`์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. | โ๏ธ |+| dns_over_https | DNS ์ฟผ๋ฆฌ๋ฅผ Cloudflare DNS-over-HTTPS๋ก ๋ณด๋ด ํ๋ก์ ์ฌ์ฉ ์ DNS ์ ์ถ์ ๋ง์ต๋๋ค. | โ๏ธ |+| proxy_rotator | ์๋ ํ๋ก์ ์ํ์ ์ฌ์ฉํ `ProxyRotator` ๊ฐ์ฒด์ ๋๋ค. `proxy`์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. | โ๏ธ |+| retries | ์คํจํ ์์ฒญ์ ์ฌ์๋ ํ์์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 3์ ๋๋ค. | โ๏ธ |+| retry_delay | ์ฌ์๋ ์ฌ์ด์ ๊ธฐ๋ค๋ฆฌ๋ ์ด ๋จ์ ์๊ฐ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 1์ ๋๋ค. | โ๏ธ |+| record_requests | ์๋ฃ๋ ์์ฒญ๊ณผ ์ ์ฅ๋ ์๋ต์ `session.network`์ ๋ณด๊ดํฉ๋๋ค. ์ธ์ ์ ์ฉ์ด๋ฉฐ ๊ธฐ๋ณธ๊ฐ์ `False`์ ๋๋ค. | โ๏ธ |+| max_recorded_requests | ์ธ์ ๋ณ๋ก ๋ณด๊ดํ ์์ฒญ์ ์ต๋ ๊ฐ์์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 1,000์ ๋๋ค. ์ ์ฅํ๋ ๋ณธ๋ฌธ์๋ ๊ณ ์ ๋ ํฌ๊ธฐ ์ ํ๋ ์์ต๋๋ค. | โ๏ธ |+| executable_path | ํจ๊ป ์ ๊ณต๋๋ Chromium ๋์ ์ฌ์ฉํ ๋ธ๋ผ์ฐ์ ์คํ ํ์ผ์ ์ ๋ ๊ฒฝ๋ก์ ๋๋ค. ์ผ๋ฐ์ ์ด์ง ์์ ์ค์น๋ ์์ฒด ๋ธ๋ผ์ฐ์ ๋น๋์ ์ ์ฉํฉ๋๋ค. | โ๏ธ |++์ธ์ ํด๋์ค์์๋ ์ด ์ธ์๋ค์ ์ธ์ ์ ์ฒด์ ์ค์ ํ ์ ์์ต๋๋ค. ํญ ๋จ์๋ก ์ ์ฉํ ์ ์๋ ๋ค์ ์ธ์๋ ์์ฒญ๋ง๋ค ๋ค๋ฅด๊ฒ ์ ๋ฌํ ์๋ ์์ต๋๋ค: `google_search`, `timeout`, `wait`, `page_action`, `page_setup`, `extra_headers`, `disable_resources`, `wait_selector`, `wait_selector_state`, `network_idle`, `load_dom`, `pierce_shadow`, `solve_cloudflare`, `blocked_domains`, `proxy`, `selector_config`.++!!! note "์ฐธ๊ณ "++ 1. ์ ํ ์คํธ์์ `disable_resources`๋ ์ผ๋ถ ์ฌ์ดํธ์ ์์ฒญ์ ์ฝ 25% ๋น ๋ฅด๊ฒ ํ์ต๋๋ค. ํ๋ก์ ์ฌ์ฉ๋๋ ์ค์ผ ์ ์์ต๋๋ค. ๋ค๋ง ์ผ๋ถ ์ฌ์ดํธ๋ ๋ก๋ฉ์ด ๋๋์ง ์์ ์ ์์ผ๋ ์ฃผ์ํ์ธ์.+ 2. `google_search`๋ ๋ชจ๋ ์์ฒญ์์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ผ๋ฉฐ Referer๋ฅผ `https://www.google.com/`์ผ๋ก ์ค์ ํฉ๋๋ค. `extra_headers`์ ํจ๊ป ์ฌ์ฉํ๋ฉด ๊ทธ๊ณณ์์ ์ค์ ํ Referer๋ณด๋ค ์ฐ์ ํฉ๋๋ค.+ 3. User-Agent๋ฅผ ์ง์ ํ์ง ์๊ณ ์ฐฝ ์๋ ๋ชจ๋๋ฅผ ์ผ๋ฉด Fetcher๊ฐ ๊ฐ์ ๋ธ๋ผ์ฐ์ ๋ฒ์ ์ ์ค์ User-Agent๋ฅผ ์์ฑํฉ๋๋ค. User-Agent๋ฅผ ์ง์ ํ์ง ์๊ณ ์ฐฝ ์๋ ๋ชจ๋๋ ์ผ์ง ์์๋ค๋ฉด ๋ธ๋ผ์ฐ์ ์ ๊ธฐ๋ณธ User-Agent๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ต์ ๋ฒ์ ์์๋ ์ผ๋ฐ ๋ธ๋ผ์ฐ์ ์ ๊ฐ์ ๊ฐ์ ๋๋ค.+ 4. `init_script`๋ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ์ ๋ฑ๋ก๋์ด ํ์ด์ง ์์ฑ ์ ์คํ๋ฉ๋๋ค. ์คํ ์ค ๋ชจ๋๋ ๊ธฐ๋ณธ์ ์ผ๋ก Patchright์ ๊ฒฉ๋ฆฌ๋ ์คํ ์ปจํ ์คํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์คํฌ๋ฆฝํธ๊ฐ `window`์ ๋ฃ์ ์ ์ญ ๊ฐ์ `page_action`์์ ์ฝ์ด์ผ ํ๋ค๋ฉด, ํด๋น ํจ์ ์์์ `page.evaluate(..., isolated_context=False)`๋ฅผ ํธ์ถํ์ธ์.++## ์ธ์ ๊ด๋ฆฌ {#session-management}++๊ฐ์ ์ค์ ์ผ๋ก ์ฌ๋ฌ ์์ฒญ์ ๋ณด๋ผ ๋์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ด์ด๋๋ ค๋ฉด `StealthySession`/`AsyncStealthySession`์ ์ฌ์ฉํ์ธ์. ์ด ํด๋์ค๋ค์ `fetch`์ ๊ฐ์ ์ธ์๋ฅผ ๋ฐ์ผ๋ฏ๋ก ์ธ์ ์ ์ฒด๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค.++```python+from scrapling.fetchers import StealthySession+++with StealthySession(+ headless=True,+ disable_resources=True,+ real_chrome=True+) as session:++ page1 = session.fetch('https://example1.com')+ page2 = session.fetch('https://example2.com')+ page3 = session.fetch('https://dynamic-site.com')+++```++### ๋น๋๊ธฐ ์ธ์ ์ฌ์ฉ๋ฒ {#async-session-usage}++```python+import asyncio+from scrapling.fetchers import AsyncStealthySession++async def scrape_multiple_sites():+ async with AsyncStealthySession(+ network_idle=True,+ timeout=30000,+ max_pages=3+ ) as session:++ pages = await asyncio.gather(+ session.fetch('https://spa-app1.com'),+ session.fetch('https://spa-app2.com'),+ session.fetch('https://dynamic-content.com')+ )+ return pages+```++`max_pages`๋ ์ฌ์ฌ์ฉํ **๋ธ๋ผ์ฐ์ ํญ ํ**์ ํฌ๊ธฐ๋ฅผ ์ ํฉ๋๋ค. ๋์์ ์ด์ด๋ ์ ์๋ ํญ์ ์ต๋ ๊ฐ์์ ๋๋ค. ์์ฒญ์ด ๋๋๋ ํญ์ ์ด์ด๋๋ฉฐ, ๊ฐ ์์ฒญ์์ ๋ค์ ์์ ์ ํฉ๋๋ค.++1. ์ฌ์ฉํ์ง ์๋ ํญ์ด ์์ผ๋ฉด ์ฌ์ฌ์ฉํฉ๋๋ค. ๊ฐ ์์ฒญ์ ํ ๋น๋ฐ์ ํญ์ ์์ฒด ์ค์ (`timeout`, `extra_headers`, `disable_resources`, `blocked_domains` ๋ฑ)์ ์ ์ฉํ๋ฏ๋ก ์ด์ ์์ฒญ์ ์ค์ ์ด ๋จ์ง ์์ต๋๋ค.+2. ๋น ํญ์ด ์๊ณ ์ด๋ฆฐ ํญ ์๊ฐ `max_pages`๋ณด๋ค ์ ์ผ๋ฉด ์ ํญ์ ์ฝ๋๋ค.+3. ๊ทธ๋ ์ง ์์ผ๋ฉด 1์ด๋ณด๋ค ์งง์ ๊ฐ๊ฒฉ์ผ๋ก ๋น ํญ์ด ์๊ฒผ๋์ง ํ์ธํฉ๋๋ค. 60์ด๊ฐ ์ง๋๋ ์์ผ๋ฉด `TimeoutError`๋ฅผ ๋ฐ์์ํต๋๋ค. ๋์ ์ฌ์ดํธ๊ฐ ์๋ตํ์ง ์์ ๋ ์ด๋ฐ ์ํฉ์ด ์๊ธธ ์ ์์ต๋๋ค.++์ค๋ฅ๊ฐ ๋ ํญ์ ๋ซ๊ณ ๊ต์ฒดํฉ๋๋ค. `session.close_pages()`๋ก ์ธ์ ๋ ๋ชจ๋ ํญ์ ๋ซ์ ์๋ ์์ต๋๋ค. ๋ค์ ์์ฒญ์ ์ ํญ์ ์ฝ๋๋ค.++์ด ๋ฐฉ์์ ๊ฐ์ ๋ธ๋ผ์ฐ์ ์์ ์ฌ๋ฌ URL์ ๋์์ ๊ฐ์ ธ์ฌ ์ ์์ด ๋ฆฌ์์ค๋ฅผ ๋ง์ด ์๋ผ๊ณ ๋น ๋ฅด๊ฒ ๋์ํฉ๋๋ค :)++ํญ์ ์ด์ด๋๋ฉด ๊ฐ์ ธ์จ ํ์ด์ง๊ฐ ๋ค์ ์์ฒญ๊น์ง ๋จ์ต๋๋ค. ๋ค์ ์์ฒญ์ `page_setup`์ ๋ค๋ฅธ ํ์ด์ง๋ก ์ด๋ํ๊ธฐ ์ ์ ๊ธฐ์กด ํ์ด์ง์์ ์คํ๋ฉ๋๋ค. ์ด๋ฅผ ์ด์ฉํด ์ฌ๋ฌ ์์ฒญ์ ๊ฑธ์น ์๋ํ๋ฅผ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค.++0.3.2๋ถํฐ 0.4.14๊น์ง๋ ํญ์ ์ฌ์ฌ์ฉํ ๋ ์ด์ ์ค์ ์ด ๋จ๋ ๋ฌธ์ ๋ก ์์ฒญ๋ง๋ค ํญ์ ๋ซ์์ต๋๋ค. 0.4.15๋ถํฐ๋ ์ฌ์ฌ์ฉํ ๋๋ง๋ค ์ค์ ์ ์ด๊ธฐํํ๋ฏ๋ก ํญ์ ์ด์ด๋ก๋๋ค.++### ์ธ์ ์ํ ์ ์ฅ๊ณผ ๋ถ๋ฌ์ค๊ธฐ {#save-and-load-session-state}++`save_state(path)`๋ ์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ JSON ํ์ผ์ ์ ์ฅํฉ๋๋ค. `load_state(path)`๋ ๋ค๋ฅธ ์ธ์ ์ ๋ณต์ํ๊ฑฐ๋ ํ์ฌ ์ธ์ ์ ์ ์ฅ ์ํ๋ฅผ ๋ฐ๊ฟ๋๋ค. ๋ ๋ฉ์๋๋ ๋ฌธ์์ด ๋๋ `pathlib.Path`๋ฅผ ๋ฐ๊ณ `None`์ ๋ฐํํฉ๋๋ค. ํ์์ Playwright์ ์คํ ๋ฆฌ์ง ์ํ ํ์ผ๊ณผ ํธํ๋ฉ๋๋ค.++```python+from scrapling.fetchers import StealthySession++with StealthySession() as session:+ session.fetch('https://example.com')+ session.save_state('state.json')++with StealthySession() as session:+ session.load_state('state.json')+ page = session.fetch('https://example.com')+```++๋ก๊ทธ์ธ์ด๋ ๋ค๋ฅธ ๋ธ๋ผ์ฐ์ ์์ ์ด ๋๋ ๋ค ์ ์ฅํ์ธ์. ๋ ๋ฉ์๋๋ ์คํ ์ค์ธ ์ธ์ ์์์ ์งํ ์ค์ธ ๋ชจ๋ ์์ฒญ์ด ๋๋ ๋ค ํธ์ถํด์ผ ํฉ๋๋ค. ๋ถ๋ฌ์ค๊ธฐ๋ ๊ธฐ์กด ์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ ๋ฐ๊ฟ๋๋ค. ๋ณต์ํ ๋ก๊ทธ์ธ ์ํ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ฑฐ๋ ์๋ก๊ณ ์นจํ์ธ์. ์ํ๋ฅผ ๋ถ๋ฌ์ค๋ ๊ฒ๋ง์ผ๋ก ๊ธฐ์กด ํญ์ด ์ด๋ํ์ง๋ ์์ต๋๋ค.++`AsyncStealthySession`์์๋ `await`๋ฅผ ์ฌ์ฉํฉ๋๋ค.++```python+from scrapling.fetchers import AsyncStealthySession++async def restore_session():+ async with AsyncStealthySession() as session:+ await session.load_state('state.json')+ page = await session.fetch('https://example.com')+ await session.save_state('state.json')+ return page+```++์ด ๋ฉ์๋๋ค์ ๊ณต์ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ๋ง ์ ์ฅํ๊ณ ๋ณต์ํฉ๋๋ค. ์์ฒญ๋ณ ํ๋ก์์ ์์ ์ปจํ ์คํธ์๋ ์ํฅ์ ์ฃผ์ง ์์ต๋๋ค. `proxy_rotator`๋ฅผ ์ฌ์ฉํ๋ ์ธ์ ์๋ ๊ณต์ ์ปจํ ์คํธ๊ฐ ์์ผ๋ฏ๋ก `RuntimeError`๊ฐ ๋ฐ์ํฉ๋๋ค. ๊ณ ์ ๋ ์ธ์ `proxy`๋ ํ์์ฒ๋ผ ์ฌ์ฉํ ์ ์์ต๋๋ค.++ํ์ผ์๋ `sessionStorage`, ์ด๋ฆฐ ํญ, ๋ธ๋ผ์ฐ์ ์ค์ ์ด ํฌํจ๋์ง ์์ต๋๋ค. ์ ์ฅํ๋ฉด ํ์ผ์ ๋ฎ์ด์ฐ๋ฉฐ, ์์ ๋๋ ํฐ๋ฆฌ๋ ๋ฏธ๋ฆฌ ์์ด์ผ ํฉ๋๋ค. ํ์ผ๊ณผ JSON ์ค๋ฅ๋ ํธ์ถํ ์ฝ๋์ ์ ๋ฌ๋ฉ๋๋ค.++### ์ธ์ ์ ์ฅ์ {#session-benefits}++- **๋ธ๋ผ์ฐ์ ์ฌ์ฌ์ฉ**: ๊ฐ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ์ดํ ์์ฒญ์ด ํจ์ฌ ๋น ๋ฆ ๋๋ค.+- **์ฟ ํค ์ ์ง**: ์ผ๋ฐ ๋ธ๋ผ์ฐ์ ์ฒ๋ผ ์ฟ ํค์ ์ธ์ ์ํ๋ฅผ ์๋์ผ๋ก ๊ด๋ฆฌํฉ๋๋ค.+- **์ผ๊ด๋ ์ง๋ฌธ**: ๋ชจ๋ ์์ฒญ์์ ๊ฐ์ ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ์ฌ์ฉํฉ๋๋ค.+- **๋ฉ๋ชจ๋ฆฌ ํจ์จ**: ์์ฒญ๋ง๋ค ์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๊ฒ๋ณด๋ค ๋ฆฌ์์ค๋ฅผ ์ ๊ฒ ์ฌ์ฉํฉ๋๋ค.+++## ์์ {#examples}+์์ ๋ฅผ ๋ณด๋ฉด ๋ ์ฝ๊ฒ ์ดํดํ ์ ์์ต๋๋ค.++### ๋ฆฌ์์ค ์ ์ด {#resource-control}++```python++page = StealthyFetcher.fetch('https://example.com', disable_resources=True)+```++### Shadow DOM {#shadow-dom}++์ผ๋ถ ํ์ด์ง๋ ์ผ๋ฐ HTML์ ํฌํจ๋์ง ์๋ open ๋ชจ๋์ Shadow Root ์์ ๋ด์ฉ์ ์ ์ฅํฉ๋๋ค. `pierce_shadow`๋ฅผ ์ผ๋ฉด ์ด ๋ด์ฉ๋ ์๋ต์ ํฌํจ๋ฉ๋๋ค. ๊ทธ๋ค์ CSS๋ XPath ์ ํ์๋ฅผ ํ์์ฒ๋ผ ์ฌ์ฉํ๋ฉด ๋ฉ๋๋ค.++```python+from scrapling.fetchers import StealthyFetcher++page = StealthyFetcher.fetch('https://example.com', pierce_shadow=True)+titles = page.css('product-card .title::text').getall()+```++๊ธฐ๋ณธ๊ฐ์ `False`์ ๋๋ค. ์ธ์ ์ ์ฒด์์ ์ผ๊ณ ํน์ ์์ฒญ์์๋ง ๋ ์๋ ์์ต๋๋ค.++```python+from scrapling.fetchers import StealthySession++with StealthySession(pierce_shadow=True) as session:+ page = session.fetch('https://example.com')+ plain_page = session.fetch('https://example.com', pierce_shadow=False)+```++๊ฐ์ ์ต์ ์ `async_fetch`์ ๋น๋๊ธฐ ์ธ์ ์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.++open ๋ชจ๋์ Shadow Root๋ง ํฌํจ๋ฉ๋๋ค. closed ๋ชจ๋์ ๋ฃจํธ์ iframe ๋ฌธ์๋ ํ์ํ์ง ์์ต๋๋ค. ์ปดํฌ๋ํธ๊ฐ ํ์ด์ง๋ณด๋ค ๋ฆ๊ฒ ๋ก๋๋๋ฉด `wait_selector`๋ฅผ ์ฌ์ฉํ์ธ์.++open ๋ชจ๋์ ๊ฐ ๋ฃจํธ๋ ์๋ต์์ `<shadow-root>` ๋ํผ๊ฐ ๋ฉ๋๋ค. ์ฌ๋กฏ์ ํ๊ทธ์ ์์ฑ์ ์ ์งํ๋ฉฐ ํ ๋น๋ ๋ ธ๋๋ฅผ ๋ด์ต๋๋ค. ํ ๋น๋ ๋ ธ๋๊ฐ ์์ผ๋ฉด ๋์ฒด ๋ด์ฉ์ ๋ด์ต๋๋ค. ํ ๋น๋์ง ์์ Light DOM ์์์ ์ ์ธ๋ฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์ ์ค์ ํ์ด์ง๋ ๋ฐ๋์ง ์์ต๋๋ค.++```html+<product-card>+ <shadow-root>+ <div class="title">Product name</div>+ <slot name="price"><span class="price">20</span></slot>+ </shadow-root>+</product-card>+```++ํ์ ์ ํ์๋ ์ด ์์๋ค์ ๊ฐ๋ก์ง๋ฌ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ฐ๋ก ์๋ ์์์ ๊ณ ๋ฅด๋ ์ ํ์์๋ ๋ํผ์ ์ฌ๋กฏ๋ ํฌํจํด์ผ ํฉ๋๋ค.++```python+titles = page.css('product-card .title::text').getall()+titles = page.css('product-card > shadow-root > .title::text').getall()+prices = page.css('product-card > shadow-root > slot[name="price"] > .price::text').getall()+```++๋ํผ์ ์ฌ๋กฏ์ XPath ๊ฒฝ๋ก, `.children`, `response.body`, HTML ๋ด๋ณด๋ด๊ธฐ์ ๋ํ๋ฉ๋๋ค. Markdown๊ณผ ํ ์คํธ ์ถ์ถ์ ํ๊ทธ ์์ด ๋ด์ฉ๋ง ๋ฐํํฉ๋๋ค. ์จ๊ฒจ์ง ์ฌ๋กฏ์ ์์ฑ๋ ๋จ์ ์์ผ๋ฏ๋ก ์ฝํ ์ธ ์ ๋ฆฌ ์์ ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.++์ค๋ ์ท์ ๋ด์ฉ์ ์์๋ฅผ ๋ฐ๋ฅด์ง๋ง CSS ํ์ ์ฌ๋ถ๋ ๋ ์ด์์์ ๊ณ์ฐํ์ง ์์ต๋๋ค. `<shadow-root>`๊ฐ ์๋ ์ ํ์๋ ์ค์ ๋ธ๋ผ์ฐ์ ํ์ด์ง๊ฐ ์๋๋ผ Scrapling ์๋ต์ ์ ์ฉํฉ๋๋ค. ๋ค๋ฅธ HTML ํ์๋ ํน์ดํ ์ค์ฒฉ ๊ตฌ์กฐ๋ฅผ ๋ค๋ฅด๊ฒ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.++### ๋๋ฉ์ธ ์ฐจ๋จ {#domain-blocking}++```python++page = StealthyFetcher.fetch('https://example.com', blocked_domains={"ads.example.com", "tracker.net"})+```++### ๋คํธ์ํฌ ์ ์ด {#network-control}++```python++page = StealthyFetcher.fetch('https://example.com', network_idle=True)+++page = StealthyFetcher.fetch('https://example.com', timeout=30000)+++page = StealthyFetcher.fetch('https://example.com', proxy='http://username:password@host:port')+```++### ํ์ผ ๋ค์ด๋ก๋ {#downloading-files}++```python+page = StealthyFetcher.fetch('https://raw.githubusercontent.com/D4Vinci/Scrapling/main/docs/assets/main_cover.png')++with open(file='main_cover.png', mode='wb') as f:+ f.write(page.body)+```++`Response` ๊ฐ์ฒด์ `body` ์์ฑ์ ํญ์ `bytes`๋ฅผ ๋ฐํํฉ๋๋ค.++### ํ์ด์ง ์ด๋ ์ ์ค์ {#pre-navigation-setup}+ํ์ด์ง ์ด๋ ์ ์ ์ด๋ฒคํธ ๋ฆฌ์ค๋, ๋ผ์ฐํธ, ์คํฌ๋ฆฝํธ๋ฅผ ๋ฑ๋กํด์ผ ํ๋ค๋ฉด `page_setup`์ ์ฌ์ฉํ์ธ์. ์ด ํจ์๋ `page` ๊ฐ์ฒด๋ฅผ ๋ฐ๊ณ `page.goto()` ํธ์ถ ์ ์ ์คํ๋ฉ๋๋ค.++```python+from patchright.sync_api import Page++def capture_websockets(page: Page):+ page.on("websocket", lambda ws: print(f"WebSocket opened: {ws.url}"))++page = StealthyFetcher.fetch('https://example.com', page_setup=capture_websockets)+```+๋น๋๊ธฐ ๋ฒ์ ์ ๋๋ค.+```python+from patchright.async_api import Page++async def capture_websockets(page: Page):+ page.on("websocket", lambda ws: print(f"WebSocket opened: {ws.url}"))++page = await StealthyFetcher.async_fetch('https://example.com', page_setup=capture_websockets)+```++`page_action`๊ณผ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. `page_setup`์ ์ด๋ ์ ์, `page_action`์ ์ด๋ ํ์ ์คํ๋ฉ๋๋ค.++### Cloudflare์ ์คํ ์ค ์ต์ {#cloudflare-and-stealth-options}++```python++page = StealthyFetcher.fetch('https://nopecha.com/demo/cloudflare', solve_cloudflare=True)+++page = StealthyFetcher.fetch(+ 'https://protected-site.com',+ solve_cloudflare=True,+ block_webrtc=True,+ real_chrome=True,+ hide_canvas=True,+ google_search=True,+ proxy='http://username:password@host:port', # It can also be a dictionary with only the keys 'server', 'username', and 'password'.+)+```++`solve_cloudflare`๋ ๋ชจ๋ ์ข ๋ฅ์ Cloudflare Turnstile/Interstitial ๊ฒ์ฌ๋ฅผ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ์ฒ๋ฆฌํฉ๋๋ค.++- JavaScript ๊ฒ์ฌ(managed).+- ํ์ธ ์์๋ฅผ ํด๋ฆญํ๋ ๋ํํ ๊ฒ์ฌ.+- ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์๋์ผ๋ก ์ฒ๋ฆฌ๋๋ ๋ณด์ด์ง ์๋ ๊ฒ์ฌ.++CAPTCHA๊ฐ ํฌํจ๋ ์ฌ์ฉ์ ์ง์ ํ์ด์ง๋ ์ฒ๋ฆฌํฉ๋๋ค.++!!! notes "**์ค์ํ ์ฐธ๊ณ ์ฌํญ**"++ 1. ๋ณดํธ ๊ธฐ๋ฅ์ ์์ฒด์ ์ผ๋ก ๊ตฌํํ ์ฌ์ดํธ์์๋ CAPTCHA ์ฒ๋ฆฌ ํ ์ค์ ์ฝํ ์ธ ๊ฐ ๋ก๋๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฌ๋๋ก `wait_selector`๋ฅผ ์จ์ผ ํ ์ ์์ต๋๋ค. ์ต๋ํ ์ฌ๋ฌ ์ฌ์ดํธ์์ ์๋ํ๋๋ก ๋ง๋ค๊ณ ์์ง๋ง, ๋งค์ฐ ํน์ดํ ์ฌ๋ก๋ ์์ต๋๋ค.+ 2. Cloudflare ์ฒ๋ฆฌ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ค๋ฉด ์ถฉ๋ถํ ์ฒ๋ฆฌ ์๊ฐ์ ํ๋ณดํ๋๋ก ์ ํ ์๊ฐ์ ์ต์ 60์ด๋ก ์ค์ ํ์ธ์.+ 3. ์ด ๊ธฐ๋ฅ์ ํ๋ก์์ ๋ค๋ฅธ ์คํ ์ค ์ต์ ๊ณผ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.++### ๋ธ๋ผ์ฐ์ ์๋ํ {#browser-automation}+์ฌ๊ธฐ์ [Playwright์ Page API](https://playwright.dev/python/docs/api/class-page) ์ง์์ด ํ์ํฉ๋๋ค. ์ ๋ฌํ ํจ์๋ Playwright์ ํ์ด์ง ๊ฐ์ฒด๋ฅผ ๋ฐ์ ํ์ํ ์์ ์ ์ํํ๊ณ , ๊ทธ ๋ค์ Fetcher๊ฐ ์ฒ๋ฆฌ๋ฅผ ์ด์ด๊ฐ๋๋ค.++์ด ํจ์๋ `network_idle`์ด ์ผ์ ธ ์๋ค๋ฉด ๊ทธ ๋๊ธฐ๋ฅผ ๋ง์น ์งํ, `wait_selector`๋ฅผ ๊ธฐ๋ค๋ฆฌ๊ธฐ ์ ์ ์คํ๋ฉ๋๋ค. ์๋ํ ์ธ์ ์ฉ๋๋ก๋ ์ธ ์ ์์ผ๋ฉฐ ํ์ด์ง๋ฅผ ์ํ๋ ๋๋ก ๋ฐ๊ฟ ์ ์์ต๋๋ค.++๋ค์ ์์์๋ ํ์ด์ง์ [๋ง์ฐ์ค ์ด๋ฒคํธ](https://playwright.dev/python/docs/api/class-mouse)๋ก ํ ์ ์คํฌ๋กคํ๊ณ ๋ง์ฐ์ค๋ฅผ ์์ง์ ๋๋ค.+```python+from patchright.sync_api import Page++def scroll_page(page: Page):+ page.mouse.wheel(10, 0)+ page.mouse.move(100, 400)+ page.mouse.up()++page = StealthyFetcher.fetch('https://example.com', page_action=scroll_page)+```+๋น๋๊ธฐ ๊ฐ์ ธ์ค๊ธฐ ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ํจ์๋ ๋น๋๊ธฐ๋ก ์์ฑํด์ผ ํฉ๋๋ค.+```python+from patchright.async_api import Page++async def scroll_page(page: Page):+ await page.mouse.wheel(10, 0)+ await page.mouse.move(100, 400)+ await page.mouse.up()++page = await StealthyFetcher.async_fetch('https://example.com', page_action=scroll_page)+```++### ๋๊ธฐ ์กฐ๊ฑด {#wait-conditions}++```python++page = StealthyFetcher.fetch(+ 'https://quotes.toscrape.com/js-delayed/',+ wait_selector='.quote',+ wait_selector_state='visible'+)+```+์ด ์ต์ ์ ์ผ๋ฉด ์๋ต์ ๋ฐํํ๊ธฐ ์ ์ ์ง์ ํ ์กฐ๊ฑด์ ๊ธฐ๋ค๋ฆฝ๋๋ค. `wait_selector`์ CSS ์ ํ์๋ฅผ ์ ๋ฌํ๋ฉด `wait_selector_state`๋ก ์ง์ ํ ์ํ๊ฐ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. ์ํ๋ฅผ ์๋ตํ๋ฉด ๊ธฐ๋ณธ๊ฐ์ธ `attached`๋ฅผ ์ฌ์ฉํด ์์๊ฐ DOM์ ๋ํ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.++๊ทธ ํ `load_dom`์ด ์ผ์ ธ ์๋ค๋ฉด(๊ธฐ๋ณธ๊ฐ), ๋ชจ๋ JavaScript ํ์ผ์ ๋ก๋์ ์คํ์ด ๋๋ฌ๋์ง, ์ฆ `domcontentloaded` ์ํ์ธ์ง ๋ค์ ํ์ธํ๊ณ ํ์ํ๋ฉด ๊ณ์ ๊ธฐ๋ค๋ฆฝ๋๋ค. `network_idle`๋ ์ผ์ ธ ์๋ค๋ฉด ์์ ์ค๋ช ํ `network_idle` ์กฐ๊ฑด์ ๋ค์ ๊ธฐ๋ค๋ฆฝ๋๋ค.++๊ธฐ๋ค๋ฆด ์ ์๋ ์ํ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค([์ถ์ฒ](https://playwright.dev/python/docs/api/class-page#page-wait-for-selector)).++- `attached`: ์์๊ฐ DOM์ ์์ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.+- `detached`: ์์๊ฐ DOM์ ์์ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.+- `visible`: ์์์ ๊ฒฝ๊ณ ์์๊ฐ ๋น์ด ์์ง ์๊ณ `visibility:hidden`์ด ์๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. ๋ด์ฉ์ด ์๊ฑฐ๋ `display:none`์ธ ์์๋ ๊ฒฝ๊ณ ์์๊ฐ ๋น์ด ์์ผ๋ฏ๋ก ๋ณด์ด๋ ๊ฒ์ผ๋ก ๊ฐ์ฃผํ์ง ์์ต๋๋ค.+- `hidden`: ์์๊ฐ DOM์์ ์ ๊ฑฐ๋๊ฑฐ๋, ๊ฒฝ๊ณ ์์๊ฐ ๋น๊ฑฐ๋, `visibility:hidden`์ด ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค. `'visible'`์ ๋ฐ๋์ ๋๋ค.++### ๋คํธ์ํฌ ๊ธฐ๋ก {#network-history}++๋ธ๋ผ์ฐ์ ์ธ์ ์์ `record_requests`๋ฅผ ์ผ๋ฉด ํ์ด์ง ๋ก๋ฉ, ์์ , ์ฌ๋ฌ ํญ์ ๊ฑธ์น ์๋ฃ๋ ์์ฒญ์ ํ์ธํ ์ ์์ต๋๋ค. ๊ธฐ๋ก์ ์์ ํ๋ก์ ์ปจํ ์คํธ๋ฅผ ํฌํจํ ์ธ์ ์ ์ปจํ ์คํธ๋ฅผ ๋ค๋ฃจ๋ฉฐ ์๋ต์ Scrapling `Response` ๊ฐ์ฒด๋ก ์ ์ฅํฉ๋๋ค. ์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ API ํธ์ถ, HTTP ์ค๋ฅ, ๋ฆฌ๋๋ ์ ์ ์ฐพ์ ์ ์์ต๋๋ค. ์ ์ฅ๋ ํค๋์ ๋ณธ๋ฌธ์ ์ธ์ ์ ๋ซ์ ๋ค์๋ ์ฝ์ ์ ์์ต๋๋ค. ์คํจํ๊ฑฐ๋ ๋๋์ง ์์ ์์ฒญ์ ์ ์ธํ์ง๋ง, ์๋ฃ๋ HTTP 4xx์ 5xx ์๋ต์ ํฌํจํฉ๋๋ค.++```python+from scrapling.fetchers import StealthySession++with StealthySession(record_requests=True, max_recorded_requests=1000) as session:+ session.fetch('https://example.com', network_idle=True)++for response in session.network.search(resource_type='document', limit=None):+ print(response.meta['network_id'], response.url, response.status)+ if note := response.meta.get('body_note'):+ print(note)+ else:+ print(response.body)+ print(response.css('title::text').get())++session.network.clear()+```++`AsyncStealthySession`์์๋ ๊ฐ์ API๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ธฐ๋ก์ ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค. ์ธ์ ์ ๋ง๋ค ๋ `record_requests=True`๋ฅผ ์ค์ ํ๊ณ , ํ์ํ๋ฉด `max_recorded_requests`๋ ์ง์ ํ์ธ์.++- `session.network.search(url_pattern=None, method=None, resource_type=None, status=None, after_id=0, limit=100, include_static=True)`๋ ์ ์ฅ๋ `Response`๋ฅผ ๋คํธ์ํฌ ID ์์๋ก ๋ฐํํฉ๋๋ค. `limit=None`์ ๋ณด๊ด ์ค์ธ ์ผ์น ๊ฒฐ๊ณผ๋ฅผ ๋ชจ๋ ๋ฐํํฉ๋๋ค. `url_pattern`์ ๊ฒ์ํ ๋ ์ ์ฉํ๋ ์ ๊ท์์ ๋๋ค. ์๋ชป๋ ํจํด์ ๊ทธ ์์ ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. `after_id`๋ ๋ ํฐ ๋คํธ์ํฌ ID๋ฅผ ๊ฐ์ง ์๋ต์ ์ ํํฉ๋๋ค. `include_static=False`๋ XHR/fetch ์์ฒญ๊ณผ HTTP ์ค๋ฅ๋ง ๋จ๊น๋๋ค. ๋ชจ๋ ๋ฆฌ์์ค ํ์ ๊ณผ ์ ์ฅ๋ ๋ฆฌ๋๋ ์ ์ ํฌํจํ๋ ค๋ฉด `True`๋ฅผ ์ฌ์ฉํ์ธ์.+- `session.network.get(request_id)`๋ ์ ์ฅ๋ `Response` ํ๋๋ฅผ ๋ฐํํฉ๋๋ค. ๋๋ ๋ณด๊ดํ์ง ์์ผ๋ฉด `None`์ ๋ฐํํฉ๋๋ค.+- `session.network.clear()`๋ ๊ธฐ๋ก์ ์ง์๋๋ค. ์์ฒญ ID๋ ๊ณ์ ์ฆ๊ฐํ๋ฉฐ ์ฌ์ฌ์ฉ๋์ง ์์ต๋๋ค.++์ ์ฅ๋ ๊ฐ `Response`์์ `.url`, `.method`, `.status`, `.headers`, `.request_headers`, `.body` ๋ฐ์ดํธ, `.json()`, CSS/XPath ๋ฉ์๋๋ฅผ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. `.meta`์๋ `network_id`, `resource_type`, `request_body`(๋ฐ์ดํธ ๋๋ `None`)๊ฐ ์์ต๋๋ค. ์ ์ฒด ํค๋๋ฅผ ์ฝ์ง ๋ชปํ๋ฉด ์ผ๋ถ๋ง ์ ๊ณต๋ ์ ์์ต๋๋ค. ๋น๋๊ธฐ ์ธ์ ์์๋ ๋ก์ปฌ ์ฝ๊ธฐ ์์ ์ด๋ฏ๋ก await๋ฅผ ์ฌ์ฉํ๊ฑฐ๋ `.body()`๋ฅผ ํธ์ถํ์ง ๋ง์ธ์. ์ ์ฅ๋ ๋ด์ฉ์ ํ์ฑํ ์ ์์ด๋ ๋ฐ์ดํธ๋ ์ ์งํ์ง๋ง, CSS/XPath ๋ฉ์๋๋ ๋น ๋ฌธ์๋ฅผ ์ฌ์ฉํฉ๋๋ค.++URL๋ก API ํธ๋ํฝ์ ์ฐพ์ผ๋ ค๋ฉด `session.network.search(url_pattern=r'https://api\.example\.com/.*', limit=None)`์ ์ฌ์ฉํ์ธ์. ํน์ ์์ฒญ ํ์ ๋ง ํ์ํ๋ฉด `resource_type='fetch'` ๋๋ `resource_type='xhr'`๋ฅผ ์ถ๊ฐํ์ธ์.++๊ธฐ๋ก ๊ธฐ๋ฅ์ ์ง์ํ๋ ํ ์คํธ `Content-Type`์ ์๋ต ๋ณธ๋ฌธ๋ง ์ฝ๊ณ ์ ์ฅํฉ๋๋ค. ๋์์ `text/*`, `+json`/`+xml` ํ์ (SVG ํฌํจ), JSON, XML, JavaScript, GraphQL, URL ์ธ์ฝ๋ฉ๋ ํผ ๋ฐ์ดํฐ์ ๋๋ค. ๋ฐ์ด๋๋ฆฌ๋ ์ ์ ์๋ ํ์ , `Content-Type`์ด ์๋ ์๋ต์ ๋ฉํ๋ฐ์ดํฐ๋ง ๋ณด๊ดํ๊ณ ๋ณธ๋ฌธ ๋ฐ์ดํธ๋ ์ ์ฅํ์ง ์์ต๋๋ค. ๋ธ๋ผ์ฐ์ ๋ ๋ฆฌ์์ค๋ฅผ ํ์์ฒ๋ผ ๋ก๋ํฉ๋๋ค.++์ ์ฅ๋ ์๋ต ๋ฐ์ดํธ๋ Playwright์์ ๊ฐ์ ธ์ค๋ฏ๋ก ์๋ฒ๊ฐ ๋ณด๋ธ ์๋ ๋ฐ์ดํธ์ ๋ค๋ฅผ ์ ์์ต๋๋ค. ์ ์ฅ๋ ๋ฐ์ดํธ๊ฐ ์ฌ๋ฐ๋ฅธ UTF-8์ด๋ฉด Playwright์ฒ๋ผ UTF-8๋ก ์ฒ๋ฆฌํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ์๋ต์ ์ ์ธ๋ ๋ฌธ์ ์ธ์ฝ๋ฉ์ ์ฌ์ฉํฉ๋๋ค. ์๋ต ํค๋๋ ๋ฐ๊พธ์ง ์์ต๋๋ค.++๊ฑด๋๋ฐ์๊ฑฐ๋ ๋๋ฌด ํฌ๊ฑฐ๋ ์ฝ์ ์ ์๋ ๋ณธ๋ฌธ์ `b''`๋ฅผ ๋ฐํํ๊ณ , ์ด์ ๋ฅผ `response.meta.get('body_note')`์ ๋ฃ์ต๋๋ค. ํ ์คํธ๊ฐ ์๋๋ฉด `Non-text body; not saved.`๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์๋ต ๋ฉํ๋ฐ์ดํฐ์ ์ฝ์ ์ ์๋ ํค๋๋ ์ ์งํฉ๋๋ค. ๋น ํ ์คํธ๋ฅผ ํฌํจํด ์ ์ฅ๋ ํ ์คํธ์๋ ๋ฉ๋ชจ๊ฐ ์์ต๋๋ค. HEAD ์๋ต๊ณผ ์ํ ์ฝ๋ 204, 205, 304๋ ๋ฉ๋ชจ ์์ด ๋น ์ํ๋ก ๋จ์ต๋๋ค.++๊ธฐ๋ก์ `search`, `get`, `clear`๋ ๋น๋๊ธฐ ์ธ์ ์์๋ ๋ก์ปฌ ๋๊ธฐ ํธ์ถ์ ๋๋ค. ์๋ต์ ๋ณํํ๊ณ ์ ์ฅํ ๋ค์๋ง ๊ธฐ๋ก์ด ๋ํ๋ฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์ด๋ฒคํธ๋ Playwright๊ฐ ๋์ ์ค์ผ ๋ ์ฒ๋ฆฌ๋๋ฉฐ, ๋น๋๊ธฐ ๊ธฐ๋ก์๋ ์ด๋ฒคํธ ๋ฃจํ ์คํ๋ ํ์ํฉ๋๋ค. ๊ธฐ๋ก์ ์ฝ๋ ์์ ์ ์์ง ์๋ฃ๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์์ต๋๋ค.++์ธ์ ์ ๋ซ์ ๋๋ ์์ง ์๋ฃ๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์์ต๋๋ค. ํ์ด์ง ์ด๋์ด๋ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ ์ข ๋ฃ ์ ์์ง ์์ง ์ค์ธ ์๋ต์ ์ ์ธ๋ ์ ์์ต๋๋ค. ์ด๋ฏธ ์ ์ฅ๋ ์๋ต์ ์ข ๋ฃ ํ์๋ ์ฝ์ ์ ์์ต๋๋ค.++๊ธฐ๋ณธ์ ์ผ๋ก ์ต๋ 1,000๊ฐ์ ์์ฒญ์ ๋ณด๊ดํฉ๋๋ค. ์ ์ฅ๋ ์๋ต ๋ณธ๋ฌธ์ ๊ฐ๊ฐ 1 MiB, ์ ์ฒด 20 MiB๋ก ์ ํ๋ฉ๋๋ค. ๋ณด๊ด ํ๋์ ๋๋ฌํ๋ฉด ์ค๋๋ ๊ธฐ๋ก์ ์ ๊ฑฐํฉ๋๋ค. ๋ณธ๋ฌธ ํฌ๊ธฐ ์ ํ์ ๊ณ ์ ๊ฐ์ด๋ฉฐ ์ธ์ ์ค์ ์ด ์๋๋๋ค. ์ด ์ ํ์ ์ ์ฅ๋ ํญ๋ชฉ๊ณผ ์๋ต ๋ฐ์ดํธ์๋ง ์ ์ฉํฉ๋๋ค. ๋ธ๋ผ์ฐ์ ์ ์ฒด ๋ฉ๋ชจ๋ฆฌ, ๋์ ์์ง, ์์ ์ ์ฒด ๋ณธ๋ฌธ ์ฝ๊ธฐ, ํ์ฑ๋ HTML, ์์ฒญ ๋ณธ๋ฌธ์๋ ์ ์ฉํ์ง ์์ต๋๋ค.++#### v5๋ก ์ด์ ํ๊ธฐ {#migrating-in-v5}++v5์์๋ `capture_xhr`์ `response.captured_xhr`๊ฐ ์ ๊ฑฐ๋์์ต๋๋ค. `record_requests=True`๋ก ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ง์ ๋ง๋ค๊ณ `session.network.search(url_pattern=..., limit=None)`์ผ๋ก ์ฝ์ผ์ธ์. ์ผํ์ฉ Fetcher์ API ๊ธฐ๋ก๋ ์ด ๋ฐฉ์์ผ๋ก ๋์ฒดํ๋ฏ๋ก ์ธ์ ๊ฐ์ฒด๋ฅผ ์ ์งํด์ผ ํฉ๋๋ค. ํํฐ๋ ์์ง ์์ ์ด๋ ํ ๋ฒ์ ๊ฐ์ ธ์ค๊ธฐ๊ฐ ์๋๋ผ ์ธ์ ์ ์ฒด์ ์ ์ฅ ๊ธฐ๋ก์ ์ ์ฉํฉ๋๋ค. ์ง์ํ๋ ํ ์คํธ ์๋ต ๋ณธ๋ฌธ๋ง ์ ์ฅํฉ๋๋ค. `search()`๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ต๋ 100๊ฐ๋ฅผ ๋ฐํํฉ๋๋ค. `limit=None`์ ๊ธฐ๋ก์ ๋ณด๊ด ํ๋๋ฅผ ๋ฐ๊พธ์ง ์๊ณ ๋ณด๊ด ์ค์ธ ์ผ์น ๊ฒฐ๊ณผ๋ฅผ ๋ชจ๋ ๋ฐํํฉ๋๋ค.++### ๋ธ๋ผ์ฐ์ ํค๋์ ๋ก์บ {#browser-headers-and-locale}++```python+page = StealthyFetcher.fetch(+ 'https://example.com',+ google_search=True,+ useragent='Mozilla/5.0...',+ locale='en-US',+)+```++### ์ ์ฒด ์์ {#general-example}+```python+from scrapling.fetchers import StealthyFetcher++def scrape_dynamic_content():++ page = StealthyFetcher.fetch(+ 'https://example.com/dynamic',+ network_idle=True,+ wait_selector='.content'+ )+++ content = page.css('.content')++ return {+ 'title': content.css('h1::text').get(),+ 'items': [+ item.text for item in content.css('.item')+ ]+ }+```++### ํ๋ก์ ์ํ {#proxy-rotation}++```python+from scrapling.fetchers import StealthySession, ProxyRotator+++rotator = ProxyRotator([+ "http://proxy1:8080",+ "http://proxy2:8080",+ "http://proxy3:8080",+])+++with StealthySession(proxy_rotator=rotator, headless=True) as session:+ page1 = session.fetch('https://example1.com')+ page2 = session.fetch('https://example2.com')+++ page3 = session.fetch('https://example3.com', proxy='http://specific-proxy:8080')+```++!!! warning "์ฃผ์"++ ๋ชจ๋ ๋ธ๋ผ์ฐ์ Fetcher์ ์ธ์ ์ ๊ธฐ๋ณธ์ ์ผ๋ก ํญ ํ์ ๊ฐ์ง ์๊ตฌ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค. ํ์ง๋ง ๋ธ๋ผ์ฐ์ ๋ ํญ๋ณ๋ก ํ๋ก์๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ `ProxyRotator`๋ฅผ ์ฌ์ฉํ๋ฉด Fetcher๊ฐ ํ๋ก์๋ง๋ค ๋ณ๋ ์ปจํ ์คํธ๋ฅผ ์ด๊ณ ๊ฐ๊ฐ ํ๋์ ํญ์ ๋ง๋ญ๋๋ค. ํญ์ ์์ ์ด ๋๋๋ฉด ํญ๊ณผ ์ปจํ ์คํธ๋ฅผ ๋ชจ๋ ๋ซ์ต๋๋ค.++## ์ธ์ ์ฌ์ฉํ๋์? {#when-to-use}++๋ค์ ๊ฒฝ์ฐ์๋ StealthyFetcher๋ฅผ ์ฌ์ฉํ์ธ์.++- ๋ด ์ฐจ๋จ์ ์ฐํํด์ผ ํ ๋.+- ์ ๋ขฐํ ์ ์๋ ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ด ํ์ํ ๋.+- JavaScript๋ฅผ ์์ ํ ์คํํด์ผ ํ ๋.+- ์๋ ์คํ ์ค ๊ธฐ๋ฅ์ด ํ์ํ ๋.+- ๋ธ๋ผ์ฐ์ ์๋ํ๊ฐ ํ์ํ ๋.+- Cloudflare ๋ณดํธ ๊ธฐ๋ฅ์ ๋์ํด์ผ ํ ๋.diff --git a/docs/locales/ko/index.md b/docs/locales/ko/index.mdnew file mode 100644index 0000000..7247b22--- /dev/null+++ b/docs/locales/ko/index.md@@ -0,0 +1,243 @@+---+title: "Scrapling: Python ์น ์คํฌ๋ํ ํ๋ ์์ํฌ"+description: "Scrapling: ํ๋์ ์ธ ์น์ ๊ฐํธํ๊ฒ ์คํฌ๋ํํ์ธ์!"+---++<style>+.md-typeset h1 {+ display: none;+}+[data-md-color-scheme="default"] .only-dark { display: none; }+[data-md-color-scheme="slate"] .only-light { display: none; }+</style>++<br/>+<div align="center">+ <a href="index.html" alt="ํ์ง ์ด๋ฏธ์ง">+ <img alt="Scrapling" src="assets/cover_light.svg" class="only-light">+ <img alt="Scrapling" src="assets/cover_dark.svg" class="only-dark">+ </a>+</div>++<h2 align="center"><i>ํ๋์ ์ธ ์น์ ๊ฐํธํ๊ฒ ์คํฌ๋ํํ์ธ์</i></h2><br>++Scrapling์ ๋น ๋ฅธ HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ , ๊ฐ๋ ฅํ ํ์ฑ, ๋์ ํฌ๋กค๋ง์ ํ๋๋ก ๋ฌถ์ Python ์น ์คํฌ๋ํ ํ๋ ์์ํฌ์ ๋๋ค.++์ ์ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ณ , JavaScript๋ฅผ ์คํํ๊ณ , ์ฌ์ดํธ๋ฅผ ์กฐ์ํ๊ณ , ์ฌ์ดํธ๊ฐ ํธ์ถํ๋ API์์ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ์ธ์. ์ธ์ ์ฌ์ฌ์ฉ, ํ๋ก์ ๊ต์ฒด, ์๋ ์ฌ์๋, ์ผ์ ์ ์ง์ ์ฌ๊ฐ, ๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ๋ฅผ ์ง์ํ๋ ํฌ๋กค๋ฌ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.++Python์ด๋ ํฐ๋ฏธ๋์์ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, MCP ์๋ฒ์ Agent Skill์ ํตํด AI ์์ด์ ํธ์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ช ๊ฐ์ ํ๋๋ฅผ ์ถ์ถํ๋ ์์ ๋ถํฐ ์ฌ์ดํธ ์ ์ฒด๋ฅผ ๊น๋ํ Markdown ํ์ผ๋ก ์ ์ฅํ๋ ์์ ๊น์ง ์ง์ํฉ๋๋ค.++## Scrapling์ผ๋ก ํ ์ ์๋ ์ผ {#what-you-can-do-with-scrapling}++- **[ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ์ ์กฐ์](fetching/choosing.md)**: ๋น ๋ฅธ HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ , JavaScript ์คํ, Cloudflare Turnstile๊ณผ Interstitial ์ฒ๋ฆฌ, ์ง์ ์ธ์ , ๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต ๊ธฐ๋ก.+- **[ํ์ฑ๊ณผ ๋ฐ์ดํฐ ์ถ์ถ](parsing/selection.md)**: CSS, XPath, ํ ์คํธ์ ์ ๊ท์ ๊ฒ์, ํ์ด์ง๊ฐ ๋ฐ๋ ๋ค์๋ ์์ ์ถ์ , ๋น์ทํ ์์ ์ฐพ๊ธฐ, ๊น๋ํ Markdown ์ถ๋ ฅ.+- **[ํฌ๋กค๋ง๊ณผ ๋ด๋ณด๋ด๊ธฐ](spiders/getting-started.md)**: ๋์ ํฌ๋กค๋ง, ํ๋ก์ ๊ต์ฒด, ์ฌ์๋, AutoThrottle, ์ผ์ ์ ์ง์ ์ฌ๊ฐ, ์คํธ๋ฆฌ๋ฐ, ๋ฐ๋ก ์ธ ์ ์๋ ํ ํ๋ฆฟ, JSONยทJSONLยทCSVยทXML ๋ด๋ณด๋ด๊ธฐ.+- **[AI๋ ํฐ๋ฏธ๋์์ ์คํฌ๋ํ](ai/mcp-server.md)**: AI ์์ด์ ํธ๊ฐ ์ฌ์ดํธ๋ฅผ ํ์ํ๊ณ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๋ MCP ์๋ฒ, Agent Skill, CLI ๋ช ๋ น์ด, ๋ํํ ์ ธ.++ํ ํ์ด์ง๋ถํฐ ์์ํ์ธ์:++```python+from scrapling.fetchers import Fetcher++page = Fetcher.get('https://quotes.toscrape.com/')+quotes = page.css('.quote .text::text').getall()+print(quotes)+```++์คํ์ด๋๋ก ์ฌ๋ฌ ํ์ด์ง๋ฅผ ์์งํ ์๋ ์์ต๋๋ค:++```python+from scrapling.spiders import Spider, Response++class QuotesSpider(Spider):+ name = "quotes"+ start_urls = ["https://quotes.toscrape.com/"]++ async def parse(self, response: Response):+ for quote in response.css('.quote'):+ yield {+ "text": quote.css('.text::text').get(),+ "author": quote.css('.author::text').get(),+ }++result = QuotesSpider().start()+print(len(result.items))+result.items.to_json("quotes.json")+```++์ด ์ฝ๋๋ `10`์ ์ถ๋ ฅํ๊ณ ๋ช ์ธ๊ณผ ์ ์๋ฅผ `quotes.json`์ ์ ์ฅํฉ๋๋ค.++## ์ฃผ์ ํ์์ฌ {#top-sponsors}++--8<-- "sponsors.html"++<i><sub>์ฌ๊ธฐ์ ๊ด๊ณ ๋ฅผ ์ฌ๋ฆฌ๊ณ ์ถ์ผ์ ๊ฐ์? [์ฌ๊ธฐ](https://github.com/sponsors/D4Vinci)์์ ์๊ธ์ ๋ฅผ ์ ํํ๊ณ ๋ค๋ฅธ ํํ๋ ๋ฐ์ ๋ณด์ธ์!</sub></i>++## ์ฃผ์ ๊ธฐ๋ฅ {#key-features}++### ์คํ์ด๋: ๋ณธ๊ฒฉ์ ์ธ ํฌ๋กค๋ง ํ๋ ์์ํฌ {#spiders-a-full-crawling-framework}+- ๐ท๏ธ **Scrapy์ ๋น์ทํ Spider API**: `start_urls`, ๋น๋๊ธฐ `parse` ์ฝ๋ฐฑ, `Request`/`Response` ๊ฐ์ฒด๋ก ์คํ์ด๋๋ฅผ ์ ์ํฉ๋๋ค.+- โก **๋์ ํฌ๋กค๋ง**: ๋์์ ์ฒ๋ฆฌํ ์์ฒญ ์, ๋๋ฉ์ธ๋ณ ์ ํ, ๋ค์ด๋ก๋ ์ฌ์ด์ ๋๊ธฐ ์๊ฐ์ ์ค์ ํฉ๋๋ค.+- ๐ **์ฌ๋ฌ ์ธ์ ์ง์**: ํ ์คํ์ด๋์์ HTTP ์์ฒญ๊ณผ ์คํ ์ค ํค๋๋ฆฌ์ค ๋ธ๋ผ์ฐ์ ๋ฅผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ์ธ์ ID๋ก ๊ฐ ์์ฒญ์ ๋ณด๋ผ ์ธ์ ์ ๊ณ ๋ฆ ๋๋ค.+- ๐พ **์ผ์ ์ ์ง์ ์ฌ๊ฐ**: `crawldir`๋ก ๋๊ธฐ ์ค์ธ ์์ฒญ๊ณผ ๋ฐฉ๋ฌธํ URL์ ์ ์ฅํฉ๋๋ค. Ctrl+C๋ก ์์ ํ๊ฒ ๋ฉ์ถ ๋ค ๊ฐ์ ํด๋๋ก ๋ค์ ์์ํ๋ฉด ์ด์ด์ ์คํ๋ฉ๋๋ค.+- ๐ก **์คํธ๋ฆฌ๋ฐ**: `async for item in spider.stream()`์ผ๋ก ์ถ์ถํ ํญ๋ชฉ์ ๋ฐ๋ก ๋ฐ๊ณ ์ค์๊ฐ ํต๊ณ๋ฅผ ํ์ธํฉ๋๋ค. ํ๋ฉด ํ์, ๋ฐ์ดํฐ ์ฒ๋ฆฌ, ๊ธด ํฌ๋กค๋ง ์์ ์ ์ ํฉํฉ๋๋ค.+- ๐ก๏ธ **์ฐจ๋จ ๊ฐ์ง**: ์ฐจ๋จ๋ ์์ฒญ์ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ์ฌ์๋ํฉ๋๋ค. ์ฒ๋ฆฌ ๋ฐฉ์๋ ๋ฐ๊ฟ ์ ์์ต๋๋ค.+- ๐ฆ **AutoThrottle**: ๋๊ธฐ ์๊ฐ์ ์ง์ ์ถ์ธกํ ํ์๊ฐ ์์ต๋๋ค. ์คํ์ด๋๊ฐ ์๋ต ์๋์ ๋ง์ถฐ ๋๋ฉ์ธ๋ณ ๋๊ธฐ ์๊ฐ์ ์กฐ์ ํฉ๋๋ค. ์ฐจ๋จ์ด๋ ์์ฒญ ๋น๋ ์ ํ์ด ์์๋๋ฉด ๋ ๋ฐฐ๋ก ๋๋ฆฌ๊ฑฐ๋ `Retry-After`๊ฐ ์ง์ ํ ์๊ฐ๋งํผ ๊ธฐ๋ค๋ฆฌ๊ณ , ๋ฌธ์ ๊ฐ ์ฌ๋ผ์ง๋ฉด ๋ค์ ์๋๋ฅผ ๋์ ๋๋ค.+- ๐ค **robots.txt ์ค์**: `robots_txt_obey`๋ฅผ ์ผ๋ฉด `Disallow`, `Crawl-delay`, `Request-rate` ๊ท์น์ ๋ฐ๋ฆ ๋๋ค. ๊ท์น์ ๋๋ฉ์ธ๋ณ๋ก ์บ์ํฉ๋๋ค.+- ๐งช **๊ฐ๋ฐ ๋ชจ๋**: ์ฒซ ์คํ์์ ์๋ต์ ๋์คํฌ์ ์ ์ฅํ๊ณ ๋ค์ ์คํ๋ถํฐ ๋ค์ ์ฌ์ฉํฉ๋๋ค. ์๋ฒ์ ๋ค์ ์์ฒญํ์ง ์๊ณ `parse()`๋ฅผ ์์ ํ๋ฉฐ ์ํํ ์ ์์ต๋๋ค.+- ๐งฉ **๋ฐ๋ก ์ฐ๋ ์คํ์ด๋ ํ ํ๋ฆฟ**: `CrawlSpider`๋ ๊ท์น์ ๋ฐ๋ผ ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ๊ณ , `SitemapSpider`๋ sitemap๊ณผ robots.txt๋ฅผ ์ฌ์ฉํฉ๋๋ค. `XMLFeedSpider`/`CSVFeedSpider`๋ XMLยทRSSยทCSV ํผ๋๋ฅผ ์ฝ์ต๋๋ค. `ShopifySpider`๋ ๊ณต๊ฐ Shopify ์คํ ์ด์์ ์ํ์ ์์งํ๋ฉฐ, ์ํ ์ต์ ์กฐํฉ๋ง๋ค ํ ํญ๋ชฉ์ ๋ง๋ญ๋๋ค.+- ๐ **๋งํฌ ์ถ์ถ**: `LinkExtractor`๋ ํ์ฉยท์ ์ธ ํจํด, ๋๋ฉ์ธ ํํฐ, CSSยทXPath ๋ฒ์ ์ง์ , ํ์ฅ์ ํํฐ, URL ์ ๊ทํ๋ฅผ ์ง์ํฉ๋๋ค. ํ ํ๋ฆฟ ์์์ ๋๋ ๋จ๋ ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.+- ๐ฆ **๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ**: ํ ๊ณผ ์์ฒด ์ฒ๋ฆฌ ๊ณผ์ ์ผ๋ก ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ๊ฑฐ๋ ๋ด์ฅ JSONยทJSONLยทCSVยทXML ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ธ์. `result.items.to_json()`, `to_jsonl()`, `to_csv()`, `to_xml()`์ ํธ์ถํ๋ฉด ๋ฉ๋๋ค.++### ์ธ์ ์ ์ฌ์ฉํ ์ฌ์ดํธ ๊ฐ์ ธ์ค๊ธฐ {#advanced-websites-fetching-with-session-support}+- **HTTP ์์ฒญ**: `Fetcher`๋ก ๋น ๋ฅด๊ณ ํ์งํ๊ธฐ ์ด๋ ค์ด HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ๋ธ๋ผ์ฐ์ ์ TLS ์ง๋ฌธ๊ณผ ํค๋๋ฅผ ํ๋ด ๋ด๊ณ HTTP/3๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.+- **๋์ ํ์ด์ง**: `StealthyFetcher`๋ก ๋ธ๋ผ์ฐ์ ๋ฅผ ์๋ ์กฐ์ํ๋ฉฐ ๋์ ์ฌ์ดํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค. Playwright์ Chromium๊ณผ Google Chrome์ ์ง์ํฉ๋๋ค.+- **๋ด ์ฐจ๋จ ์ฐํ**: `StealthyFetcher`๋ ์๋ํ ํ์ ์ ์จ๊ธฐ๊ณ ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ์์ฅํฉ๋๋ค. ๋ชจ๋ ์ ํ์ Cloudflare Turnstile๊ณผ Interstitial ๊ฒ์ฌ๋ฅผ ์๋์ผ๋ก ํต๊ณผํ ์ ์์ต๋๋ค.+- **์ธ์ ๊ด๋ฆฌ**: `FetcherSession`๊ณผ `StealthySession`์ ์์ฒญ ์ฌ์ด์ ์ฟ ํค์ ์ํ๋ฅผ ์ ์งํฉ๋๋ค.+- **ํ๋ก์ ๊ต์ฒด**: `ProxyRotator`๋ ๋ชจ๋ ์ธ์ ์์ ํ๋ก์๋ฅผ ์์๋๋ก ๋๋ ์ ํ ๊ท์น์ ๋ฐ๋ผ ๊ต์ฒดํฉ๋๋ค. ์์ฒญ๋ง๋ค ๋ค๋ฅธ ํ๋ก์๋ฅผ ์ง์ ํ ์๋ ์์ต๋๋ค.+- **๋๋ฉ์ธ๊ณผ ๊ด๊ณ ์ฐจ๋จ**: ํน์ ๋๋ฉ์ธ๊ณผ ํ์ ๋๋ฉ์ธ์ผ๋ก ๋ณด๋ด๋ ์์ฒญ์ ๋ง์ ์ ์์ต๋๋ค. ๋ธ๋ผ์ฐ์ Fetcher์ ๊ด๊ณ ์ฐจ๋จ ๊ธฐ๋ฅ์ ์ฝ 3,500๊ฐ์ ๊ด๊ณ ยท์ถ์ ๋๋ฉ์ธ์ ์ฐจ๋จํฉ๋๋ค.+- **DNS ์ ์ถ ๋ฐฉ์ง**: DNS-over-HTTPS๋ฅผ ์ผ๋ฉด Cloudflare์ DoH๋ฅผ ํตํด DNS๋ฅผ ์กฐํํฉ๋๋ค. ํ๋ก์๋ฅผ ์ธ ๋ DNS๊ฐ ์์ด ๋๊ฐ๋ ๊ฒ์ ๋ง์ต๋๋ค.+- **์๊ฒฉ ๋ธ๋ผ์ฐ์ **: `cdp_url`๋ก CDP๋ฅผ ํตํด ์ด๋ฏธ ์คํ ์ค์ธ ๋ธ๋ผ์ฐ์ ์ ์ฐ๊ฒฐํฉ๋๋ค. ๊ฐ์ ์ปดํจํฐ, ๋ค๋ฅธ ์๋ฒ, ๋ธ๋ผ์ฐ์ ์ ๊ณต ์๋น์ค ์ด๋์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. `executable_path`๋ก ์ง์ ๋ง๋ Chromium์ ๋ธ๋ผ์ฐ์ Fetcher์ ์ง์ ํ ์๋ ์์ต๋๋ค.+- **๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต ๊ธฐ๋ก**: ๋ธ๋ผ์ฐ์ ์ธ์ ์์ `record_requests=True`๋ฅผ ์ผ๊ณ `session.network.search(limit=None)`์ผ๋ก ์ ์ฅ๋ ์๋ต์ ๊ฒ์ํ์ธ์. ์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ ์ฌ๋ฌ ํ์ด์ง์์ ๋ฐ์ํ API ๋ฐ์ดํฐ์ HTTP ์ค๋ฅ๋ฅผ ์ฝ์ ์ ์์ต๋๋ค. ๊ธฐ๋ก์๋ ํฌ๊ธฐ ์ ํ์ด ์์ผ๋ฉฐ ํ ์คํธ ์๋ต ๋ณธ๋ฌธ์ ์ ์ฅํฉ๋๋ค.+- **๋น๋๊ธฐ ์ง์**: ๋ชจ๋ Fetcher์์ ๋น๋๊ธฐ ํธ์ถ์ ์ง์ํ๋ฉฐ, ์ ์ฉ ๋น๋๊ธฐ ์ธ์ ํด๋์ค๋ ์ ๊ณตํฉ๋๋ค.++### ํ์ฑ๊ณผ ๋ฐ์ดํฐ ์ถ์ถ {#parsing-and-data-extraction}+- ๐ **์์ ์ถ์ **: ์ฌ์ดํธ๊ฐ ๋ฐ๋์ด๋ ์ ์ฌ๋ ์๊ณ ๋ฆฌ์ฆ์ผ๋ก ์์๋ฅผ ๋ค์ ์ฐพ์ต๋๋ค.+- ๐ฏ **์ ์ฐํ ์ ํ**: CSS, XPath, ํํฐ, ํ ์คํธ, ์ ๊ท์ ๋ฑ ์ฌ๋ฌ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+- ๐ **๋น์ทํ ์์ ์ฐพ๊ธฐ**: ์ด๋ฏธ ์ฐพ์ ์์์ ๋น์ทํ ์์๋ฅผ ์๋์ผ๋ก ์ฐพ์ต๋๋ค.++### AI ๊ธฐ๋ฅ {#ai-features}+- ๐ค **MCP ์๋ฒ**: Claude๋ Cursor ๊ฐ์ AI ์ฑ๋ด๊ณผ ์์ด์ ํธ๊ฐ Scrapling์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ์์งํฉ๋๋ค. HTTP ์์ฒญ, ๋ธ๋ผ์ฐ์ ์กฐ์, ์คํฌ๋ฆฐ์ท, ์ ์ฅ๋ ๋ก๊ทธ์ธ ์ํ, ๋ฐฑ๊ทธ๋ผ์ด๋ API ์๋ต์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ ๋๊ตฌ๋ฅผ ํตํด ์ถฉ๋ถํ ๋ฅ๋ ฅ์ ๊ฐ์ง AI ๋ชจ๋ธ์ด ์์ ์ค ๋ง์ฃผ์น๋ ๋ชจ๋ CAPTCHA๋ฅผ ์ฒ๋ฆฌํ๋๋ก ๋์ต๋๋ค. Cloudflare ์ฒ๋ฆฌ ๊ธฐ๋ฅ๋ ๋ด์ฅ๋์ด ์์ต๋๋ค. ๋ชจ๋ธ์ ๋ณด๋ด๋ ๋ด์ฉ์ ์ค์ด๊ณ ๊ด๊ณ ๋ฅผ ์ฐจ๋จํ๋ฉฐ ํ๋กฌํํธ ์ธ์ ์ ์ผ๋ก๋ถํฐ ๋ชจ๋ธ์ ๋ณดํธํฉ๋๋ค. CDP ์๊ฒฉ ๋ธ๋ผ์ฐ์ ์ ์ธ์ฆ์ ์ง์ํ๋ HTTP ์ฐ๊ฒฐ๋ ์ ๊ณตํฉ๋๋ค. ([๋ฐ๋ชจ ์์](https://www.youtube.com/watch?v=qyFk3ZNwOxE))+- ๐ง **Agent Skill**: ์ค์นํด์ ์ฐ๋ [Agent Skill](ai/agent-skill.md)์ด ์ฝ๋ฉ ์์ด์ ํธ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ฒด ์ฌ์ฉ๋ฒ์ ์๋ ค ์ค๋๋ค. ์์ด์ ํธ๊ฐ ์ถ์ธก ๋์ ํ์ฌ API์ ๋ง๋ ์ฝ๋๋ฅผ ์์ฑํ๋๋ก ๋์ต๋๋ค.+- ๐ **RAG์ฉ Markdown**: ํ ์ค(`page.markdown()`)๋ก ํ์ด์ง๋ฅผ ์ ๋ฆฌํ๊ณ ์ํํ ๋ด์ฉ์ ์ ๊ฑฐํด LLM์ฉ Markdown์ผ๋ก ๋ง๋ญ๋๋ค. `ContentSpider` ํ ํ๋ฆฟ์ผ๋ก ์ฌ์ดํธ ์ ์ฒด๋ฅผ Markdown ํ์ผ๋ก ์ ์ฅํ ์๋ ์์ต๋๋ค. ์ด ๊ณผ์ ์๋ LLM์ด ํ์ํ์ง ์์ต๋๋ค. ([๋ฌธ์](ai/building-rag-systems.md))++### ๋น ๋ฅด๊ณ ์ค๋ฌด์์ ๊ฒ์ฆ๋ ๊ตฌ์กฐ {#high-performance-battle-tested-architecture}+- ๐ **๋น ๋ฅธ ์ฒ๋ฆฌ**: ์ต์ ํ๋ฅผ ํตํด ๋๋ถ๋ถ์ Python ์คํฌ๋ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ณด๋ค ๋น ๋ฅด๊ฒ ๋์ํฉ๋๋ค.+- ๐ **์ ์ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ**: ์ต์ ํํ ์๋ฃ ๊ตฌ์กฐ๋ฅผ ์ฌ์ฉํ๊ณ ํ์ํ ์์ ์๋ง ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ต๋๋ค.+- โก **๋น ๋ฅธ JSON ๋ณํ**: ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ณด๋ค 10๋ฐฐ ๋น ๋ฆ ๋๋ค.+- ๐๏ธ **์ค๋ฌด ๊ฒ์ฆ**: ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง 92%์ ์ ์ฒด ์ฝ๋์ ํ์ ํํธ๋ฅผ ๊ฐ์ท์ต๋๋ค. ์ง๋ 1๋ ๋์ ์๋ฐฑ ๋ช ์ด ๋งค์ผ ๋ฐ์ดํฐ๋ฅผ ์์งํ๋ ๋ฐ ์ฌ์ฉํ์ต๋๋ค.++### ๊ฐ๋ฐ์๋ฅผ ์ํ ํธ๋ฆฌํ ๋๊ตฌ {#developerweb-scraper-friendly-experience}+- ๐ฏ **๋ํํ ์ ธ**: Scrapling์ ํตํฉํ IPython ์ ธ์ ์ถ๊ฐํ ์ ์์ต๋๋ค. ๋จ์ถ ๋ช ๋ น๊ณผ ๋๊ตฌ๋ก ์คํฌ๋ฆฝํธ๋ฅผ ๋น ๋ฅด๊ฒ ๊ฐ๋ฐํ์ธ์. curl ์์ฒญ์ Scrapling ์์ฒญ์ผ๋ก ๋ฐ๊พธ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ธ๋ผ์ฐ์ ์์ ๋ณผ ์ ์์ต๋๋ค.+- ๐ **ํฐ๋ฏธ๋์์ ๋ฐ๋ก ์ฌ์ฉ**: ์ฝ๋๋ฅผ ํ ์ค๋ ์ฐ์ง ์๊ณ URL์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค!+- ๐ ๏ธ **DOM ํ์**: ๋ถ๋ชจ, ํ์ , ์์ ์์๋ก ์ด๋ํ๋ ๋ฉ์๋๋ฅผ ์ ๊ณตํฉ๋๋ค.+- ๐งฌ **ํ ์คํธ ์ฒ๋ฆฌ**: ์ ๊ท์, ํ ์คํธ ์ ๋ฆฌ, ๋น ๋ฅธ ๋ฌธ์์ด ์ฐ์ฐ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+- ๐ **์ ํ์ ์์ฑ**: ์ด๋ค ์์๋ ์์ ์ ์ธ CSSยทXPath ์ ํ์๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.+- ๐ **์ต์ํ API**: Scrapy์ BeautifulSoup์ ์ต์ํ๋ค๋ฉด ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค. ScrapyยทParsel๊ณผ ๊ฐ์ ๊ฐ์ ์์๋ฅผ ์ง์ํฉ๋๋ค.+- ๐ค **Scrapy ํตํฉ**: ์ฝ๋ฐฑ์ `scrapling_response` ๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ๋ถ์ด๋ฉด ์ด๋ฏธ ๊ฐ์ ธ์จ ์๋ต์ Scrapling ํ์๋ก ์ฒ๋ฆฌํ ์ ์์ต๋๋ค. ์ฝ๋๋ฅผ ์๋ก ์์ฑํ ํ์๊ฐ ์์ต๋๋ค.+- ๐ **์ ์ฒด ํ์ ํํธ**: ํธ์ง๊ธฐ ์ง์๊ณผ ์ฝ๋ ์๋ ์์ฑ์ ๋์ต๋๋ค. ์ฝ๋๊ฐ ๋ฐ๋ ๋๋ง๋ค **PyRight**์ **MyPy**๊ฐ ์ ์ฒด ์ฝ๋๋ฅผ ์๋์ผ๋ก ๊ฒ์ฌํฉ๋๋ค.+- ๐ **๋ฐ๋ก ์ฐ๋ Docker ์ด๋ฏธ์ง**: ์ ๋ฒ์ ๋ง๋ค ๋ชจ๋ ๋ธ๋ผ์ฐ์ ๊ฐ ํฌํจ๋ Docker ์ด๋ฏธ์ง๋ฅผ ์๋์ผ๋ก ๋ง๋ค๊ณ ๋ฐฐํฌํฉ๋๋ค.+++## GitHub ์คํ ๊ธฐ๋ก {#star-history}+Scrapling์ GitHub ์คํ ์๋ ๊ณต๊ฐ ์ดํ ๊พธ์คํ ๋๊ณ ์์ต๋๋ค. ์๋ ๊ทธ๋ํ์์ ํ์ธํ์ธ์.++<div id="chartContainer">+ <a href="https://github.com/D4Vinci/Scrapling">+ <img id="chartImage" alt="GitHub ์คํ ์ ๋ณํ ๊ทธ๋ํ" loading="lazy" src="https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=Date" height="400"/>+ </a>+</div>++<script>+const observer = new MutationObserver((mutations) => {+ mutations.forEach((mutation) => {+ if (mutation.attributeName === 'data-md-color-media') {+ const colorMedia = document.body.getAttribute('data-md-color-media');+ const isDarkScheme = document.body.getAttribute('data-md-color-scheme') === 'slate';+ const chartImg = document.querySelector('#chartImage');+ const baseUrl = 'https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=Date';++ if (colorMedia === '(prefers-color-scheme)' ? isDarkScheme : colorMedia.includes('dark')) {+ chartImg.src = `${baseUrl}&theme=dark`;+ } else {+ chartImg.src = baseUrl;+ }+ }+ });+});++observer.observe(document.body, {+ attributes: true,+ attributeFilter: ['data-md-color-media', 'data-md-color-scheme']+});+</script>+++## ์ค์น {#installation}+Scrapling์๋ Python 3.10 ์ด์์ด ํ์ํฉ๋๋ค:++```bash+pip install scrapling+```++!!! warning "์ฃผ์"++ ์ด ๋ช ๋ น์ ํ์์ ํ์ํ ํจํค์ง๋ง ์ค์นํฉ๋๋ค. Fetcher๋ ๋ช ๋ น์ค ๋๊ตฌ๋ ํฌํจ๋์ง ์์ต๋๋ค. ๋ฐ๋ผ์ ์ ์์ ์ฒ๋ผ `scrapling.fetchers`๋ `scrapling.spiders`์์ ๊ฐ์ ธ์ค๋ฉด `ModuleNotFoundError`๊ฐ ๋ฐ์ํฉ๋๋ค. Fetcher๋ ์คํ์ด๋๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋จผ์ ์๋ ๋ฐฉ๋ฒ์ผ๋ก Fetcher์ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ์ธ์.++### ์ถ๊ฐ ํจํค์ง {#optional-dependencies}++1. Fetcher, ๊ด๋ จ ํด๋์ค, ์๋ ์ถ๊ฐ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด Fetcher์ ๋ธ๋ผ์ฐ์ ์ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ์ธ์:+ ```bash+ pip install "scrapling[fetchers]"++ scrapling install # normal install+ scrapling install --force # force reinstall+ ```++ ๋ชจ๋ ๋ธ๋ผ์ฐ์ , ํ์ํ ์์คํ ํจํค์ง, ๋ธ๋ผ์ฐ์ ์ง๋ฌธ์ ๋ฐ๊พธ๋ ๋๊ตฌ๋ฅผ ๋ค์ด๋ก๋ํฉ๋๋ค.++ ๋ช ๋ น์ด ๋์ ์ฝ๋์์ ์ค์นํ ์๋ ์์ต๋๋ค:+ ```python+ from scrapling.cli import install++ install([], standalone_mode=False) # normal install+ install(["--force"], standalone_mode=False) # force reinstall+ ```++2. ์ถ๊ฐ ๊ธฐ๋ฅ:+++ - MCP ์๋ฒ ์ค์น:+ ```bash+ pip install "scrapling[ai]"+ ```+ - [RAG ์์คํ ๋ง๋ค๊ธฐ](ai/building-rag-systems.md)์ ํ์ํ ํจํค์ง ์ค์น:+ ```bash+ pip install "scrapling[rag]"+ ```+ - ๋ํํ ์ ธ๊ณผ `extract` ๋ช ๋ น์ด ์ค์น:+ ```bash+ pip install "scrapling[shell]"+ ```+ - ๋ชจ๋ ๊ธฐ๋ฅ ์ค์น:+ ```bash+ pip install "scrapling[all]"+ ```+ ๋ธ๋ผ์ฐ์ Fetcher๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด `scrapling install`์ ์คํํ์ธ์. HTTP ์์ฒญ์๋ ๋ธ๋ผ์ฐ์ ์ค์น๊ฐ ํ์ํ์ง ์์ต๋๋ค.++### Docker {#docker}+๋ชจ๋ ์ถ๊ฐ ๊ธฐ๋ฅ๊ณผ ๋ธ๋ผ์ฐ์ ๊ฐ ํฌํจ๋ Docker ์ด๋ฏธ์ง๋ฅผ DockerHub์์ ๋ฐ์ ์๋ ์์ต๋๋ค:+```bash+docker pull pyd4vinci/scrapling+```+๋๋ GitHub ๋ ์ง์คํธ๋ฆฌ์์ ๋ฐ์ผ์ธ์:+```bash+docker pull ghcr.io/d4vinci/scrapling:latest+```+์ด ์ด๋ฏธ์ง๋ ์ ์ฅ์์ main ๋ธ๋์น๋ฅผ ๋ฐํ์ผ๋ก GitHub Actions์์ ์๋์ผ๋ก ๋ง๋ค๊ณ ๋ฐฐํฌํฉ๋๋ค.++## ๋ฌธ์ ๊ตฌ์ฑ {#how-the-documentation-is-organized}+Scrapling์๋ ๋ง์ ๋ฌธ์๊ฐ ์์ผ๋ฏ๋ก [Diรกtaxis ๋ฌธ์ ๊ตฌ์ฑ ๋ฐฉ์](https://diataxis.fr/)์ ๋ฐ๋ฅด๋ ค๊ณ ํฉ๋๋ค.++## ํ๋ก์ ํธ ์ง์ {#support}++Scrapling์ด ๋ง์์ ๋ ๋ค๋ฉด ๋ค์ ๋ฐฉ๋ฒ์ผ๋ก ๊ฐ๋ฐ์ ์ง์ํด ์ฃผ์ธ์:++- โญ [GitHub ์ ์ฅ์](https://github.com/D4Vinci/Scrapling)์ ์คํ๋ฅผ ๋๋ฌ ์ฃผ์ธ์.+- ๐ [Twitter](https://x.com/Scrapling_dev)๋ฅผ ํ๋ก์ฐํ๊ณ [Discord](https://discord.gg/EMgGbDceNQ)์ ์ฐธ์ฌํ์ธ์.+- ๐ [ํ๋ก์ ํธ๋ฅผ ํ์ํ๊ฑฐ๋ ์ปคํผ ํ ์์ ๋ณด๋ด ์ฃผ์ธ์](donate.md). :wink:+- ๐ [GitHub Issues](https://github.com/D4Vinci/Scrapling/issues)์์ ๋ฒ๊ทธ๋ฅผ ์๋ฆฌ๊ณ ๊ธฐ๋ฅ์ ์ ์ํ์ธ์.++## ๋ผ์ด์ ์ค {#license}++์ด ํ๋ก์ ํธ๋ BSD-3 ๋ผ์ด์ ์ค๋ก ๋ฐฐํฌํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ [LICENSE](https://github.com/D4Vinci/Scrapling/blob/main/LICENSE)๋ฅผ ํ์ธํ์ธ์.diff --git a/docs/locales/ko/integrations/scrapy.md b/docs/locales/ko/integrations/scrapy.mdnew file mode 100644index 0000000..99bd837--- /dev/null+++ b/docs/locales/ko/integrations/scrapy.md@@ -0,0 +1,64 @@+---+title: "Scrapy Spider์์ Scrapling ํ์ฑ ์ฌ์ฉํ๊ธฐ"+description: "Scrapy ์๋ต์ Scrapling์ผ๋ก ๋ณํํ๊ฑฐ๋ ์ฝ๋ฐฑ์ ๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ์ถ๊ฐํ์ธ์. ๊ธฐ์กด Scrapy ํฌ๋กค๋ฌ๋ฅผ ์ ์งํ๋ฉด์ Scrapling ์ ํ์์ ์ ์ํ ํ์ฑ์ ์ฌ์ฉํ ์ ์์ต๋๋ค."+---++# Scrapy์ Scrapling ํตํฉํ๊ธฐ {#integrating-scrapling-into-scrapy}++๊ธฐ์กด Scrapy ํ๋ก์ ํธ๋ฅผ ๋ค์ ์์ฑํ์ง ์๊ณ ๋ Scrapling์ ํ์ฑ API๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. Scrapy ํตํฉ ๊ธฐ๋ฅ์ Spider ์ฝ๋ฐฑ ์์์ Scrapy ์๋ต์ Scrapling [Response](../fetching/choosing.md#response-object) ๊ฐ์ฒด๋ก ๋ณํํฉ๋๋ค. ํฌ๋กค๋ง์ ๊ณ์ Scrapy๊ฐ ๋ด๋นํ๊ณ , ํ์ฑ์ Scrapling์ด ๋ด๋นํฉ๋๋ค.++!!! note "์ค์น"++ ์ด ๊ธฐ๋ฅ์ ๊ธฐ๋ณธ Scrapling ์ค์น(`pip install scrapling`)๋ก ์ฌ์ฉํ ์ ์์ผ๋ฉฐ ์ถ๊ฐ ์์กด์ฑ ๊ทธ๋ฃน์ ํ์ํ์ง ์์ต๋๋ค. Scrapy๋ง ์ค์น๋์ด ์์ผ๋ฉด ๋ฉ๋๋ค. ๊ธฐ์กด Scrapy ํ๋ก์ ํธ๋ผ๋ฉด ์ด๋ฏธ ์ค์น๋์ด ์์ต๋๋ค.++## ์ฌ์ฉ๋ฒ {#usage}++Spider ์ฝ๋ฐฑ์ `scrapling_response` ๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ๋ถ์ด๋ฉด, ์ ๋ฌ๋ฐ๋ `response` ์ธ์๊ฐ Scrapling์ `Response`๊ฐ ๋ฉ๋๋ค.++```python+import scrapy+from scrapling.integrations.scrapy import scrapling_response+++class QuotesSpider(scrapy.Spider):+ name = "quotes"+ start_urls = ["https://quotes.toscrape.com"]++ @scrapling_response+ def parse(self, response): # `response` is now a Scrapling Response+ first_quote = response.find_by_text("The world as we have created it", partial=True)+ for quote in [first_quote, *first_quote.find_similar()]:+ card = quote.parent+ yield {+ "text": quote.get_all_text(strip=True),+ "author": card.find("small", class_="author").text,+ "tags": [tag.text for tag in card.find_all("a", class_="tag")],+ }+ next_page = response.css("li.next a::attr(href)").get()+ if next_page:+ yield scrapy.Request(response.urljoin(next_page), callback=self.parse)+```++์ด ๋ฐ์ฝ๋ ์ดํฐ๋ Scrapy๊ฐ ์ง์ํ๋ ๋ชจ๋ ์ฝ๋ฐฑ ํํ์์ ์๋ํฉ๋๋ค. ์ผ๋ฐ ํจ์, ์ ๋๋ ์ดํฐ, ์ฝ๋ฃจํด, ๋น๋๊ธฐ ์ ๋๋ ์ดํฐ๋ฅผ ์ง์ํฉ๋๋ค. ๋ํผ๋ ์ฝ๋ฐฑ์ ํํ, ์ด๋ฆ, docstring์ ์ ์งํ๋ฏ๋ก Scrapy์ ์ฝ๋ฐฑ ๊ฒ์ฌ์ contract ๊ธฐ๋ฅ๋ ๊ณ์ ์๋ํฉ๋๋ค.++๋ฐ์ฝ๋ ์ดํฐ์ [Selector](../parsing/main_classes.md#selector) ์ค์ ์ ์ ๋ฌํ ์๋ ์์ต๋๋ค. ์ด ์ค์ ์ ์์ฑ๋๋ `Response`์ ์ ๋ฌ๋ฉ๋๋ค.++```python+ @scrapling_response(adaptive=True, keep_comments=True)+ def parse_product(self, response):+ ...+```++๋ฏธ๋ค์จ์ด๋ ํ์ดํ๋ผ์ธ์ฒ๋ผ ์ฝ๋ฐฑ ๋ฐ์์ Scrapy ์๋ต์ ๊ฐ์ง๊ณ ์๋ค๋ฉด ๋ณํ ํจ์๋ฅผ ์ง์ ์ฌ์ฉํ์ธ์.++```python+from scrapling.integrations.scrapy import convert_response++scrapling_response = convert_response(scrapy_response, keep_comments=False)+```++## ์ฐธ๊ณ ์ฌํญ {#notes}++- ๋ค์ ํ์ด์ง๋ฅผ ์์ฒญํ ๋๋ ์ ์์ ์ฒ๋ผ `scrapy.Request(response.urljoin(href))`๋ฅผ yieldํ์ธ์. Scrapling์ `Response.follow()`๋ [Scrapling Spider ์์คํ ](../spiders/getting-started.md)์ฉ ์์ฒญ์ ๋ง๋ค๋ฏ๋ก Scrapy์์ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.+- ์๋ต์ `meta` ๋์ ๋๋ฆฌ๋ ์๊ฒ ๋ณต์ฌํ๋ฏ๋ก ๋ค๋ฅธ ๋ฏธ๋ค์จ์ด๊ฐ ์ ์ฅํ ๊ฐ์ฒด์๋ ๊ณ์ ์ ๊ทผํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด `scrapy-playwright`๋ฅผ ์ฌ์ฉํ๋ฉด ํ์ด์ง๋ ์ฌ์ ํ `response.meta["playwright_page"]`์ ์์ต๋๋ค.+- ์๋ณธ `Set-Cookie` ํค๋์์ ์ฟ ํค๋ฅผ ํ์ฑํด ์๋ต์ `cookies` ๋์ ๋๋ฆฌ์ ๋ฃ์ต๋๋ค.diff --git a/docs/locales/ko/overview.md b/docs/locales/ko/overview.mdnew file mode 100644index 0000000..7a16be2--- /dev/null+++ b/docs/locales/ko/overview.md@@ -0,0 +1,341 @@+---+title: "Scrapling ์์ํ๊ธฐ: ํ์ฑ, HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ "+description: "CSS, XPath, ํ ์คํธ ๊ฒ์, HTTP ์์ฒญ, ์คํ ์ค ๋ธ๋ผ์ฐ์ ์์ ๋ก Scrapling์ ์ฃผ์ ๊ธฐ๋ฅ์ ์์๋ณด์ธ์."+---++# Scrapling ์์ํ๊ธฐ {#get-started-with-scrapling}++## ๋ชฉ์ ์ ๋ง๊ฒ ์์ํ๊ธฐ {#pick-your-path}++์ด๋์ ์์ํ ์ง ๋ชจ๋ฅด๊ฒ ๋ค๋ฉด ํ๋ ค๋ ์์ ์ ๊ณ ๋ฅด์ธ์:++| ํ๊ณ ์ถ์ ์ผ | ์์ํ ๋ฌธ์ |+|:---|:---|+| ์ด๋ฏธ ๊ฐ์ง **HTML ํ์ฑํ๊ธฐ** | [์์ ์ฐพ๊ธฐ](parsing/selection.md): CSS, XPath, ํ ์คํธ๋ก ์ ํํ๊ธฐ |+| **ํ์ด์ง๋ฅผ ๋น ๋ฅด๊ฒ ๊ฐ์ ธ์** ์ํํ๊ธฐ | [Fetcher](fetching/choosing.md)๋ฅผ ๊ณจ๋ผ ๋ฐ๋ก ์ํํ๊ฑฐ๋ [๋ํํ ์ ธ](cli/interactive-shell.md)์ ์คํํ์ธ์ |+| ๋ง์ ํ์ด์ง๋ฅผ ์ฒ๋ฆฌํ **ํฌ๋กค๋ฌ ๋ง๋ค๊ธฐ** | [์คํ์ด๋](spiders/getting-started.md): ๋์ ์์ฒญ, ์ฌ๋ฌ ์ธ์ , ์ผ์ ์ ์ง์ ์ฌ๊ฐ |+| **์ฝ๋ ์์ด ์์งํ๊ธฐ** | [CLI ์ถ์ถ ๋ช ๋ น์ด](cli/extract-commands.md)๋ฅผ ์ฐ๊ฑฐ๋ [MCP ์๋ฒ](ai/mcp-server.md)๋ฅผ AI ๋๊ตฌ์ ์ฐ๊ฒฐํ์ธ์ |+| ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ **์ฎ๊ธฐ๊ธฐ** | [BeautifulSoup์์ ์ฎ๊ธฐ๊ธฐ](tutorials/migrating_from_beautifulsoup.md) ๋๋ [Scrapy์ ๋น๊ต](spiders/architecture.md#comparison-with-scrapy) |++---++๋จผ์ ํ์ฑ ๊ธฐ๋ฅ์ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ์ด์ด์ ๋ธ๋ผ์ฐ์ ๋ก ์ฌ์ดํธ๋ฅผ ๊ฐ์ ธ์ค๊ณ , ์์ฒญ์ ๋ณด๋ด๊ณ , ์๋ต์ ํ์ฑํฉ๋๋ค.++์ด ํ์ด์ง์์๋ ChatGPT๊ฐ ๋ง๋ ๋ค์ HTML์ ์์ ๋ก ์ฌ์ฉํฉ๋๋ค:+```python+html_doc = """<html>+ <head>+ <title>Complex Web Page</title>+ <style>+ .hidden { display: none; }+ </style>+ </head>+ <body>+ <header>+ <nav>+ <ul>+ <li> <a href="#home">Home</a> </li>+ <li> <a href="#about">About</a> </li>+ <li> <a href="#contact">Contact</a> </li>+ </ul>+ </nav>+ </header>+ <main>+ <section id="products" schema='{"jsonable": "data"}'>+ <h2>Products</h2>+ <div class="product-list">+ <article class="product" data-id="1">+ <h3>Product 1</h3>+ <p class="description">This is product 1</p>+ <span class="price">$10.99</span>+ <div class="hidden stock">In stock: 5</div>+ </article>++ <article class="product" data-id="2">+ <h3>Product 2</h3>+ <p class="description">This is product 2</p>+ <span class="price">$20.99</span>+ <div class="hidden stock">In stock: 3</div>+ </article>++ <article class="product" data-id="3">+ <h3>Product 3</h3>+ <p class="description">This is product 3</p>+ <span class="price">$15.99</span>+ <div class="hidden stock">Out of stock</div>+ </article>+ </div>+ </section>++ <section id="reviews">+ <h2>Customer Reviews</h2>+ <div class="review-list">+ <div class="review" data-rating="5">+ <p class="review-text">Great product!</p>+ <span class="reviewer">John Doe</span>+ </div>+ <div class="review" data-rating="4">+ <p class="review-text">Good value for money.</p>+ <span class="reviewer">Jane Smith</span>+ </div>+ </div>+ </section>+ </main>+ <script id="page-data" type="application/json">+ {+ "lastUpdated": "2024-09-22T10:30:00Z",+ "totalProducts": 3+ }+ </script>+ </body>+</html>"""+```+๋จผ์ ์ HTML์ ๋ถ๋ฌ์ต๋๋ค:+```python+import re+from scrapling.parser import Selector+page = Selector(html_doc)+page # <data='<html><head><title>Complex Web Page</tit...'>+```+์ค์ฒฉ๋ ์์๋ฅผ ํฌํจํด ํ์ด์ง์ ๋ชจ๋ ํ ์คํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค:+```python+page.get_all_text(ignore_tags=('script', 'style'))+# 'Complex Web Page\nHome\nAbout\nContact\nProducts\nProduct 1\nThis is product 1\n$10.99\nIn stock: 5\nProduct 2\nThis is product 2\n$20.99\nIn stock: 3\nProduct 3\nThis is product 3\n$15.99\nOut of stock\nCustomer Reviews\nGreat product!\nJohn Doe\nGood value for money.\nJane Smith'+```++## ์์ ์ฐพ๊ธฐ {#finding-elements}+์ํ๋ ์์๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค! ์ฌ๋ฌ ๊ฒ์ ๋ฐฉ๋ฒ์ ์์ ๋กญ๊ฒ ์กฐํฉํด ๋ณด์ธ์.++์ฒซ ๋ฒ์งธ HTML `section` ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+section_element = page.find('section')+# <data='<section id="products" schema='{"jsonabl...' parent='<main><section id="products" schema='{"j...'>+```+๋ชจ๋ `section` ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+section_elements = page.find_all('section')+# [<data='<section id="products" schema='{"jsonabl...' parent='<main><section id="products" schema='{"j...'>, <data='<section id="reviews"><h2>Customer Revie...' parent='<main><section id="products" schema='{"j...'>]+```+`id` ์์ฑ์ด `products`์ธ ๋ชจ๋ `section` ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+section_elements = page.find_all('section', {'id':"products"})+# Same as+section_elements = page.find_all('section', id="products")+# [<data='<section id="products" schema='{"jsonabl...' parent='<main><section id="products" schema='{"j...'>]+```+`id` ์์ฑ์ `product`๊ฐ ํฌํจ๋ ๋ชจ๋ `section` ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+section_elements = page.find_all('section', {'id*':"product"})+```+ํ ์คํธ๊ฐ ์ ๊ท์ `Product \d`์ ์ผ์นํ๋ `h3` ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+page.find_all('h3', re.compile(r'Product \d'))+# [<data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>, <data='<h3>Product 2</h3>' parent='<article class="product" data-id="2"><h3...'>, <data='<h3>Product 3</h3>' parent='<article class="product" data-id="3"><h3...'>]+```+ํ ์คํธ๊ฐ ์ ๊ท์ `Product`์ ์ผ์นํ๋ `h3`์ `h2` ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+page.find_all(['h3', 'h2'], re.compile(r'Product'))+# [<data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>, <data='<h3>Product 2</h3>' parent='<article class="product" data-id="2"><h3...'>, <data='<h3>Product 3</h3>' parent='<article class="product" data-id="3"><h3...'>, <data='<h2>Products</h2>' parent='<section id="products" schema='{"jsonabl...'>]+```+ํ ์คํธ๊ฐ ์ ํํ `Products`์ธ ์์๋ฅผ ์ฐพ์ต๋๋ค. ๊ณต๋ฐฑ์ ๋ฌด์ํฉ๋๋ค:+```python+page.find_by_text('Products', first_match=False)+# [<data='<h2>Products</h2>' parent='<section id="products" schema='{"jsonabl...'>]+```+ํ ์คํธ๊ฐ ์ ๊ท์ `Product \d`์ ์ผ์นํ๋ ์์๋ฅผ ์ฐพ์ ์๋ ์์ต๋๋ค:+```python+page.find_by_regex(r'Product \d', first_match=False)+# [<data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>, <data='<h3>Product 2</h3>' parent='<article class="product" data-id="2"><h3...'>, <data='<h3>Product 3</h3>' parent='<article class="product" data-id="3"><h3...'>]+```+์ง์ ํ ์์์ ๋น์ทํ ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+target_element = page.find_by_regex(r'Product \d', first_match=True)+# <data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>+target_element.find_similar()+# [<data='<h3>Product 2</h3>' parent='<article class="product" data-id="2"><h3...'>, <data='<h3>Product 3</h3>' parent='<article class="product" data-id="3"><h3...'>]+```+CSS ์ ํ์์ ์ผ์นํ๋ ์ฒซ ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+page.css('.product-list [data-id="1"]')[0]+# <data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>+```+CSS ์ ํ์์ ์ผ์นํ๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+page.css('.product-list article')+# [<data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>, <data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>, <data='<article class="product" data-id="3"><h3...' parent='<div class="product-list"> <article clas...'>]+```+XPath ์ ํ์์ ์ผ์นํ๋ ์ฒซ ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+page.xpath("//*[@id='products']/div/article")[0]+# <data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>+```+XPath ์ ํ์์ ์ผ์นํ๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค:+```python+page.xpath("//*[@id='products']/div/article")+# [<data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>, <data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>, <data='<article class="product" data-id="3"><h3...' parent='<div class="product-list"> <article clas...'>]+```++์ฌ๊ธฐ์๋ ๊ธฐ๋ณธ ๊ธฐ๋ฅ๋ง ์ดํด๋ดค์ต๋๋ค. ๊ฐ ์ ํ ๋ฉ์๋์ ์ถ๊ฐ ์ต์ ์ ๋ค์์ ์ค๋ช ํฉ๋๋ค.+## ์์์ ๋ฐ์ดํฐ ์ฝ๊ธฐ {#accessing-elements-data}+๋ค์์ฒ๋ผ ๊ฐ๋จํ ์ฝ์ ์ ์์ต๋๋ค:+```pycon+>>> section_element.tag+'section'+>>> print(section_element.attrib)+{'id': 'products', 'schema': '{"jsonable": "data"}'}+>>> section_element.attrib['schema'].json() # If an attribute value can be converted to json, then use `.json()` to convert it+{'jsonable': 'data'}+>>> section_element.text # Direct text content+''+>>> section_element.get_all_text() # All text content recursively+'Products\nProduct 1\nThis is product 1\n$10.99\nIn stock: 5\nProduct 2\nThis is product 2\n$20.99\nIn stock: 3\nProduct 3\nThis is product 3\n$15.99\nOut of stock'+>>> section_element.html_content # The HTML content of the element+'<section id="products" schema=\'{"jsonable": "data"}\'><h2>Products</h2>\n <div class="product-list">\n <article class="product" data-id="1"><h3>Product 1</h3>\n <p class="description">This is product 1</p>\n <span class="price">$10.99</span>\n <div class="hidden stock">In stock: 5</div>\n </article><article class="product" data-id="2"><h3>Product 2</h3>\n <p class="description">This is product 2</p>\n <span class="price">$20.99</span>\n <div class="hidden stock">In stock: 3</div>\n </article><article class="product" data-id="3"><h3>Product 3</h3>\n <p class="description">This is product 3</p>\n <span class="price">$15.99</span>\n <div class="hidden stock">Out of stock</div>\n </article></div>\n </section>'+>>> print(section_element.prettify()) # The prettified version+'''+<section id="products" schema='{"jsonable": "data"}'><h2>Products</h2>+ <div class="product-list">+ <article class="product" data-id="1"><h3>Product 1</h3>+ <p class="description">This is product 1</p>+ <span class="price">$10.99</span>+ <div class="hidden stock">In stock: 5</div>+ </article><article class="product" data-id="2"><h3>Product 2</h3>+ <p class="description">This is product 2</p>+ <span class="price">$20.99</span>+ <div class="hidden stock">In stock: 3</div>+ </article><article class="product" data-id="3"><h3>Product 3</h3>+ <p class="description">This is product 3</p>+ <span class="price">$15.99</span>+ <div class="hidden stock">Out of stock</div>+ </article>+ </div>+</section>+'''+>>> section_element.path # All the ancestors in the DOM tree of this element+[<data='<main><section id="products" schema='{"j...' parent='<body> <header><nav><ul><li> <a href="#h...'>,+ <data='<body> <header><nav><ul><li> <a href="#h...' parent='<html><head><title>Complex Web Page</tit...'>,+ <data='<html><head><title>Complex Web Page</tit...'>]+>>> section_element.generate_css_selector+'#products'+>>> section_element.generate_full_css_selector+'body > main > #products'+>>> section_element.generate_xpath_selector+"//*[@id='products']"+>>> section_element.generate_full_xpath_selector+"//body/main/*[@id='products']"+```++## ์์ ์ฌ์ด ์ด๋ {#navigation}+์์์ ์ฐพ์ ์์๋ฅผ ์ฌ์ฉํฉ๋๋ค:++```pycon+>>> section_element.parent+<data='<main><section id="products" schema='{"j...' parent='<body> <header><nav><ul><li> <a href="#h...'>+>>> section_element.parent.tag+'main'+>>> section_element.parent.parent.tag+'body'+>>> section_element.children+[<data='<h2>Products</h2>' parent='<section id="products" schema='{"jsonabl...'>,+ <data='<div class="product-list"> <article clas...' parent='<section id="products" schema='{"jsonabl...'>]+>>> section_element.siblings+[<data='<section id="reviews"><h2>Customer Revie...' parent='<main><section id="products" schema='{"j...'>]+>>> section_element.next # gets the next element, the same logic applies to `quote.previous`.+<data='<section id="reviews"><h2>Customer Revie...' parent='<main><section id="products" schema='{"j...'>+>>> section_element.children.css('h2::text').getall()+['Products']+>>> page.css('[data-id="1"]')[0].has_class('product')+True+```+๋ถ๋ชจ ์์๋ฟ ์๋๋ผ ์กฐ์ ์์ ์ ์ฒด๋ฅผ ์ฐจ๋ก๋ก ์ดํด๋ณผ ์๋ ์์ต๋๋ค:+```python+for ancestor in section_element.iterancestors():+ print(ancestor.tag)+```+์กฐ๊ฑด์ ๋ง๋ ์กฐ์ ์์๋ฅผ ์ฐพ์ ์๋ ์์ต๋๋ค. `Selector`๋ฅผ ๋ฐ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ฉด `True`, ์๋๋ฉด `False`๋ฅผ ๋ฐํํ๋ ํจ์๋ฅผ ์ ๋ฌํ์ธ์:+```pycon+>>> section_element.find_ancestor(lambda ancestor: ancestor.css('nav'))+<data='<body> <header><nav><ul><li> <a href="#h...' parent='<html><head><title>Complex Web Page</tit...'>+```++## ์ฌ์ดํธ ๊ฐ์ ธ์ค๊ธฐ {#fetching-websites}+Scrapling์ HTML์ ์ง์ ์ ๋ฌํ๋ ๋์ HTTP ์์ฒญ์ด๋ ๋ธ๋ผ์ฐ์ ๋ก ์ฌ์ดํธ์ ์๋ต์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.++์์ ์ ๋ง๋ Fetcher๋ฅผ ์ ํํ์ธ์.++### HTTP ์์ฒญ {#http-requests}+๊ฐ๋จํ HTTP ์์ฒญ์๋ `Fetcher` ํด๋์ค๋ฅผ ๊ฐ์ ธ์ ์ฌ์ฉํฉ๋๋ค:+```python+from scrapling.fetchers import Fetcher+page = Fetcher.get('https://scrapling.requestcatcher.com/get', impersonate="chrome")+```+๊ฐ HTTP ๋ฉ์๋๋ ๋ค์๊ณผ ๊ฐ์ด ์ฌ์ฉํฉ๋๋ค:+```python+from scrapling.fetchers import Fetcher+page = Fetcher.get('https://scrapling.requestcatcher.com/get', stealthy_headers=True)+page = Fetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, proxy='http://username:password@localhost:8030')+page = Fetcher.put('https://scrapling.requestcatcher.com/put', data={'key': 'value'})+page = Fetcher.delete('https://scrapling.requestcatcher.com/delete')+```+๋น๋๊ธฐ ์์ฒญ์๋ ๊ฐ์ ธ์ค๋ ํด๋์ค๋ฅผ ๋ค์์ฒ๋ผ ๋ฐ๊พธ์ธ์:+```python+from scrapling.fetchers import AsyncFetcher+page = await AsyncFetcher.get('https://scrapling.requestcatcher.com/get', stealthy_headers=True)+page = await AsyncFetcher.post('https://scrapling.requestcatcher.com/post', data={'key': 'value'}, proxy='http://username:password@localhost:8030')+page = await AsyncFetcher.put('https://scrapling.requestcatcher.com/put', data={'key': 'value'})+page = await AsyncFetcher.delete('https://scrapling.requestcatcher.com/delete')+```++!!! note "์ฐธ๊ณ "++ 1. `stealthy_headers`๋ฅผ ์ผ๋ฉด Google Referer๋ฅผ ํฌํจํ ์ค์ ๋ธ๋ผ์ฐ์ ํค๋๋ฅผ ์์ฑํด ์ฌ์ฉํฉ๋๋ค. ๊ธฐ๋ณธ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.+ 2. `impersonate`๋ ์ง์ ํ ๋ธ๋ผ์ฐ์ ๋ฒ์ ์ TLS ์ง๋ฌธ์ ํ๋ด ๋ ๋๋ค.+ 3. `http3`๋ฅผ ์ผ๋ฉด HTTP/3๋ก ์์ฒญ์ ๋ณด๋ด ์ค์ ๋ธ๋ผ์ฐ์ ์ ์์ฒญ๊ณผ ๋ ๋น์ทํ๊ฒ ๋ง๋ญ๋๋ค.++์ด ๋ฐ์๋ ๋ง์ ๊ธฐ๋ฅ์ด ์์ต๋๋ค. [HTTP ์์ฒญ ๊ฐ์ด๋](fetching/static.md)๋ฅผ ํ์ธํ์ธ์.++### ๋์ ํ์ด์ง ๋ถ๋ฌ์ค๊ธฐ {#dynamic-loading}+JavaScript๋ก ๋ด์ฉ์ ๋ถ๋ฌ์ค๋ ๋์ ์ฌ์ดํธ๋ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค!++`StealthyFetcher`๋ Chromium ๊ธฐ๋ฐ ๋ธ๋ผ์ฐ์ ๋ก ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๋ ๋ค์ํ ์ต์ ์ ์ ๊ณตํฉ๋๋ค.+```python+from scrapling.fetchers import StealthyFetcher+page = StealthyFetcher.fetch('https://quotes.toscrape.com/js/', disable_resources=True, block_ads=True, wait_selector='.quote')+print(len(page.css(".quote"))) # -> 10++# The async version of fetch+page = await StealthyFetcher.async_fetch('https://quotes.toscrape.com/js/', disable_resources=True, block_ads=True, wait_selector='.quote')+print(len(page.css(".quote"))) # -> 10+```+์๋ํ ํ์ ์ ์จ๊ธฐ๋๋ก ์์ ํ [Playwright](https://playwright.dev/python/)๋ฅผ ์ฌ์ฉํฉ๋๋ค. ํฌํจ๋ Chromium, `real_chrome=True`๋ก ์ง์ ํ๋ ์ค์น๋ Google Chrome, `cdp_url`๋ก ์ฐ๊ฒฐํ๋ ์คํ ์ค์ธ ๋ธ๋ผ์ฐ์ ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.++### ๋ด ํ์ง ์ฐํ ๊ธฐ๋ฅ {#anti-bot-features}++์ฃผ์ ๊ธฐ๋ฅ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:++1. `solve_cloudflare=True`๋ก ๋ชจ๋ ์ ํ์ Cloudflare Turnstile๊ณผ Interstitial ๊ฒ์ฌ๋ฅผ ์๋์ผ๋ก ํต๊ณผํฉ๋๋ค.+2. CDP Runtime๊ณผ WebRTC ์ ์ถ์ ๋ง์ต๋๋ค.+3. JavaScript ์คํ ํ๊ฒฝ์ ๋ถ๋ฆฌํ๊ณ ์ฌ๋ฌ Playwright ํ์ ์ ์์ ๋ฉฐ, ์๋ ค์ง ๋ด ํ๋์ ๋ฐ๋ฅธ ํ์ง๋ฅผ ๋ง์ต๋๋ค.+4. Canvas์ ๋ ธ์ด์ฆ๋ฅผ ๋ฃ์ด ๋ธ๋ผ์ฐ์ ์ง๋ฌธ ์์ง์ ๋ง์ต๋๋ค.+5. ์๋ ค์ง ํค๋๋ฆฌ์ค ํ์ง ๋ฐฉ๋ฒ์ ๋์ํ๋ฉฐ, ์๊ฐ๋ ๋ถ์ผ์น๋ฅผ ์ด์ฉํ ํ์ง๋ฅผ ๋ง๋ ์ต์ ๋ ์ ๊ณตํฉ๋๋ค.+6. ์ด ๋ฐ์๋ ๋ณดํธ ๊ธฐ๋ฅ์ ์ฐํํ๋ ์ฌ๋ฌ ์ต์ ์ด ์์ต๋๋ค.++```python+from scrapling.fetchers import StealthyFetcher+page = StealthyFetcher.fetch('https://www.browserscan.net/bot-detection') # Running headless by default+page.status == 200 # -> True++page = StealthyFetcher.fetch('https://nopecha.com/demo/cloudflare', solve_cloudflare=True) # Solve Cloudflare captcha automatically if presented+page.status == 200 # -> True++page = StealthyFetcher.fetch('https://www.browserscan.net/bot-detection', block_webrtc=True, hide_canvas=True, dns_over_https=True) # and the rest of arguments...+# The async version of fetch+page = await StealthyFetcher.async_fetch('https://www.browserscan.net/bot-detection')+page.status == 200 # -> True+```++์์ธํ ์ค๋ช ๊ณผ ์ ์ฒด ์ธ์ ๋ชฉ๋ก์ [๋ธ๋ผ์ฐ์ ๊ฐ์ด๋](fetching/stealthy.md)๋ฅผ ํ์ธํ์ธ์.++---++Scrapling์ ๊ธฐ๋ณธ ๊ธฐ๋ฅ์ ์ดํด๋ดค์ต๋๋ค. ๋ ์์๋ณด๋ ค๋ฉด ๋ค์ ์น์ ์ผ๋ก ์งํํ์ธ์.diff --git a/docs/locales/ko/parsing/adaptive.md b/docs/locales/ko/parsing/adaptive.mdnew file mode 100644index 0000000..a59b129--- /dev/null+++ b/docs/locales/ko/parsing/adaptive.md@@ -0,0 +1,232 @@+---+title: "์ ์ํ ํ์ฑ์ผ๋ก HTML ์์๋ฅผ ์ถ์ ํ๊ณ ๋ค์ ์ฐพ๊ธฐ"+description: "์์์ ํน์ง์ ์ ์ฅํ๊ณ HTML์ด ๋ฐ๋ ๋ค์๋ ์ผ์นํ๋ ์์๋ฅผ ์ฐพ์ผ์ธ์. ์ ์ํ ํ์ฑ์ ์ผ๊ณ save, retrieve, relocate๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์์๋ด ๋๋ค."+---++# ์ ์ํ ์คํฌ๋ํ {#adaptive-scraping}++!!! success "์ฌ์ ์ค๋น"++ 1. [์์ ์ฐพ๊ธฐ](../parsing/selection.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector) ๊ฐ์ฒด์์ ์์๋ฅผ ์ฐพ๊ณ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 2. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector) ํด๋์ค๋ฅผ ์์๋์ธ์.++์ ์ํ ์คํฌ๋ํ์ ์ด์ ์ automatch๋ผ๊ณ ๋ถ๋ ธ๋ Scrapling์ ๊ฐ๋ ฅํ ๊ธฐ๋ฅ์ ๋๋ค. ์์๋ฅผ ์ถ์ ํ๊ณ ๋ค์ ์ฐพ์์ ์ฌ์ดํธ๊ฐ ๋ฐ๋์ด๋ ์คํฌ๋ํผ๊ฐ ๊ณ์ ์๋ํ๋๋ก ๋์ต๋๋ค.++๋ค์๊ณผ ๊ฐ์ ๊ตฌ์กฐ์ ํ์ด์ง์์ ๋ฐ์ดํฐ๋ฅผ ์์งํ๋ค๊ณ ๊ฐ์ ํด ๋ณด๊ฒ ์ต๋๋ค.+```html+<div class="container">+ <section class="products">+ <article class="product" id="p1">+ <h3>Product 1</h3>+ <p class="description">Description 1</p>+ </article>+ <article class="product" id="p2">+ <h3>Product 2</h3>+ <p class="description">Description 2</p>+ </article>+ </section>+</div>+```+ID๊ฐ `p1`์ธ ์ฒซ ๋ฒ์งธ ์ํ์ ์ถ์ถํ๋ ค๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ ํ์๋ฅผ ์์ฑํ ๊ฒ์ ๋๋ค.+```python+page.css('#p1')+```+๊ทธ๋ฐ๋ฐ ์ฌ์ดํธ ์ด์์๊ฐ ๊ตฌ์กฐ๋ฅผ ๋ค์์ฒ๋ผ ๋ฐ๊พธ๋ฉด,+```html+<div class="new-container">+ <div class="product-wrapper">+ <section class="products">+ <article class="product new-class" data-id="p1">+ <div class="product-info">+ <h3>Product 1</h3>+ <p class="new-description">Description 1</p>+ </div>+ </article>+ <article class="product new-class" data-id="p2">+ <div class="product-info">+ <h3>Product 2</h3>+ <p class="new-description">Description 2</p>+ </div>+ </article>+ </section>+ </div>+</div>+```+์ ํ์๊ฐ ๋๋ ์๋ํ์ง ์์ ์ฝ๋๋ฅผ ์์ ํด์ผ ํฉ๋๋ค. ์ด๋ Scrapling์ `adaptive` ๊ธฐ๋ฅ์ด ๋์์ด ๋ฉ๋๋ค.++Scrapling์์๋ ์์๋ฅผ ์ฒ์ ์ ํํ ๋ `adaptive` ๊ธฐ๋ฅ์ ์ผค ์ ์์ต๋๋ค. ๋ค์์ ๊ฐ์ ์์๋ฅผ ์ ํํ๋๋ฐ ์ฐพ์ง ๋ชปํ๋ฉด, ์ ์ฅํ ํน์ง์ ๋ฐํ์ผ๋ก ์ฌ์ดํธ์์ ๊ฐ์ฅ ๋น์ทํ ์์๋ฅผ ์ฐพ์ต๋๋ค. AI ์์ด๋ ๊ฐ๋ฅํฉ๋๋ค :)++```python+from scrapling import Selector, Fetcher+# Before the change+page = Selector(page_source, adaptive=True, url='example.com')+# or+Fetcher.adaptive = True+page = Fetcher.get('https://example.com')+# then+element = page.css('#p1', auto_save=True)+if not element: # One day website changes?+ element = page.css('#p1', adaptive=True) # Scrapling still finds it!+# the rest of your code...+```+๋จผ์ ์ฌ์ฉ ์๋ฅผ ๋ณด๊ณ , ์ดํ์ ์ฌ์ฉ๋ฒ๊ณผ ๋์ ์๋ฆฌ๋ฅผ ์์ธํ ์ค๋ช ํ๊ฒ ์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ CSS/XPath๋ฟ ์๋๋ผ ๋ชจ๋ ์์ ์ ํ ๋ฐฉ๋ฒ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.++## ์ค์ ์ฌ์ดํธ๋ฅผ ์ฌ์ฉํ ์ {#real-world-scenario}+์ค์ ์ฌ์ดํธ๋ฅผ ์๋ก ๋ค์ด Fetcher๋ก ์์ค๋ฅผ ๊ฐ์ ธ์ ๋ณด๊ฒ ์ต๋๋ค. ์๋๋ผ๋ฉด ๋์์ธ์ด๋ ๊ตฌ์กฐ๋ฅผ ๋ฐ๊พธ๊ธฐ ์ง์ ์ธ ์ฌ์ดํธ๋ฅผ ์ฐพ์ ์์ค๋ฅผ ์ ์ฅํ๊ณ ๋ณ๊ฒฝ์ ๊ธฐ๋ค๋ ค์ผ ํฉ๋๋ค. ์ฌ์ดํธ ์ด์์๋ฅผ ์์ง ๋ชปํ๋ฉด ๋ณ๊ฒฝ ์์ ์ ๋ฏธ๋ฆฌ ์๊ธฐ๋ ๊ฑฐ์ ๋ถ๊ฐ๋ฅํฉ๋๋ค. ์ด์์๋ฅผ ์๋ค๋ฉด ์ฐ์ถํ ํ ์คํธ๊ฐ ๋๊ฒ ์ฃ :)++๊ทธ๋์ [The Web Archive](https://archive.org/)์ [Wayback Machine](https://web.archive.org/)์ ์ฌ์ฉํ๊ฒ ์ต๋๋ค. [2010๋ StackOverFlow ์ฌ์ดํธ](https://web.archive.org/web/20100102003420/http://stackoverflow.com/)์ ์ฌ๋ณธ์ ๋๋ค. ๊ฝค ์ค๋๋์ฃ ?</br>๊ฐ์ ์ ํ์๋ก 2010๋ ๋์์ธ๊ณผ ํ์ฌ ๋์์ธ์์ ๋์ผํ ๋ฒํผ์ ์ฐพ์ ์ ์๋์ง ํ์ธํด ๋ณด๊ฒ ์ต๋๋ค :)++์ด์ ๋์์ธ์์ Questions ๋ฒํผ์ ์ถ์ถํ๋ ค๋ฉด `#hmenus > div:nth-child(1) > ul > li:nth-child(1) > a` ๊ฐ์ ์ ํ์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. Google Chrome์ด ์์ฑํ ์ ํ์๋ผ ์ง๋์น๊ฒ ๊ตฌ์ฒด์ ์ ๋๋ค.+++์ด์ ๋ ๋ฒ์ ์์ ๊ฐ์ ์ ํ์๋ฅผ ์ํํด ๋ณด๊ฒ ์ต๋๋ค.+```python+from scrapling import Fetcher+selector = '#hmenus > div:nth-child(1) > ul > li:nth-child(1) > a'+old_url = "https://web.archive.org/web/20100102003420/http://stackoverflow.com/"+new_url = "https://stackoverflow.com/"+Fetcher.configure(adaptive = True, adaptive_domain='stackoverflow.com')+page = Fetcher.get(old_url, timeout=30)+element1 = page.css(selector, auto_save=True)[0]+# Same selector but used in the updated website+page = Fetcher.get(new_url)+element2 = page.css(selector, adaptive=True)[0]++if element1.text == element2.text:+ print('Scrapling found the same element in the old and new designs!') # Spoiler alert: it does!+```+์ฌ๊ธฐ์๋ `adaptive_domain`์ด๋ผ๋ ์ ์ธ์๋ฅผ ์ฌ์ฉํ์ต๋๋ค. Scrapling์ ๋ ๋๋ฉ์ธ(`archive.org`์ `stackoverflow.com`)์ ๋ค๋ฅธ ์ฌ์ดํธ๋ก ๋ณด๋ฏ๋ก `adaptive` ๋ฐ์ดํฐ๋ฅผ ๋ฐ๋ก ์ ์ฅํฉ๋๋ค. ๋ ์ฃผ์๊ฐ ๊ฐ์ ์ฌ์ดํธ์์ ์๋ ค์ฃผ๋ ค๋ฉด, ์์ชฝ์ `adaptive` ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ๋ ๊ฐ์ ์ฌ์ฉ์ ์ง์ ๋๋ฉ์ธ์ ์ ๋ฌํด์ผ ํฉ๋๋ค.++์ค์ ์ํฉ์์๋ ์ฝ๋๋ ๊ฐ์ง๋ง ๋ ์์ฒญ์ ๊ฐ์ URL์ ์ฌ์ฉํ๋ฏ๋ก `adaptive_domain`์ ํ์ํ์ง ์์ต๋๋ค. ๊ฐ๋ฅํ ํ ์ค์ ์ํฉ์ ๊ฐ๊น๊ฒ ๋ง๋ ์์ ๋๋ค. ์ดํดํ๋ ๋ฐ ๋์์ด ๋์์ผ๋ฉด ์ข๊ฒ ์ต๋๋ค :)++์์ ๋ ์์์๋ `Selector`์ `Fetcher` ํด๋์ค๋ฅผ ๋ชจ๋ ์ฌ์ฉํด ์ ์ํ ๊ธฐ๋ฅ์ ๋์ ๋ฐฉ์์ด ๊ฐ๋ค๋ ๊ฒ์ ๋ณด์ฌ์ค๋๋ค.++!!! info "์ ๋ณด"++ `adaptive_domain`์ ์ฌ์ดํธ๊ฐ ๋์์ธ์ด๋ ๊ตฌ์กฐ์ ํจ๊ป URL๋ ๋ฐ๊ฟ ๋๋ฅผ ์ํด ๋ง๋ค์์ต๋๋ค. ์ด ์ธ์๋ฅผ ์ฌ์ฉํ๋ฉด ์ URL์์๋ ์ด์ ์ ์ ์ฅํ ์ ์ํ ๋ฐ์ดํฐ๋ฅผ ๊ณ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด Scrapling์ ์ ์ฌ์ดํธ๋ก ํ๋จํ๊ณ ์ด์ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ์ง ์์ต๋๋ค.++## ์ ์ํ ์คํฌ๋ํ์ ๋์ ์๋ฆฌ {#how-the-adaptive-scraping-feature-works}+์ ์ํ ์คํฌ๋ํ์ ๋ ๋จ๊ณ๋ก ๋์ํฉ๋๋ค.++1. **์ ์ฅ ๋จ๊ณ**: ์์๋ฅผ ๊ตฌ๋ถํ๋ ํน์ง์ ์ ์ฅํฉ๋๋ค.+2. **์ผ์น ์์ ์ฐพ๊ธฐ ๋จ๊ณ**: ๋์ค์ ๋น์ทํ ํน์ง์ ๊ฐ์ง ์์๋ฅผ ์ฐพ์ต๋๋ค.++์ด๋ค ๋ฐฉ๋ฒ์ผ๋ก๋ ์์๋ฅผ ์ ํํ ๋ค, ๋ค์์ ์ฌ์ดํธ๋ฅผ ์์งํ ๋ ๊ตฌ์กฐ๋ ๋์์ธ์ด ๋ฐ๋์ด๋ ๊ฐ์ ์์๋ฅผ ์ฐพ๊ณ ์ถ๋ค๊ณ ๊ฐ์ ํด ๋ณด๊ฒ ์ต๋๋ค.++๊ธฐ์ ์ ์ธ ์ค๋ช ์ ์ค์ด๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++ 1. ์๋์์ ์ค๋ช ํ ๋ฐฉ๋ฒ ์ค ํ๋๋ก ์์์ ํน์ง์ ์ ์ฅํ๋๋ก Scrapling์ ์์ฒญํฉ๋๋ค.+ 2. Scrapling์ ์ค์ ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๊ฐ ์์์ ํน์ง์ ์ ์ฅํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ SQLite์ ๋๋ค.+ 3. ์ฌ์ดํธ ์ด์์๋ ์์์ ๋ชจ๋ ์์ฑ์ ๋ฐ๊พธ๊ฑฐ๋ ์ง์ธ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ ์์ ์์ฒด์ ์์ฑ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๊ณ ์ ์๋ณ์๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ์ ์ฅ ์์คํ ์ ๋ ๊ฐ์ง ๊ฐ์ ์ฌ์ฉํฉ๋๋ค.+ 1. ํ์ฌ ์ฌ์ดํธ์ ๋๋ฉ์ธ์ ๋๋ค. `Selector`๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ์ด๊ธฐํํ ๋ ์ ๋ฌํ์ธ์. Fetcher๋ URL์์ ๋๋ฉ์ธ์ ์๋์ผ๋ก ๊ฐ์ ธ์ต๋๋ค.+ 2. ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ์์์ ํน์ง์ ์กฐํํ `identifier`์ ๋๋ค. ํญ์ ์ง์ ์ง์ ํด์ผ ํ๋ ๊ฒ์ ์๋๋ฉฐ, ๋ค์์ ์ค๋ช ํฉ๋๋ค.++ ๋์ค์ ์ด ๋ ๊ฐ์ ํจ๊ป ์ฌ์ฉํด ์ ์ฅ๋ ์์์ ํน์ง์ ๋ถ๋ฌ์ต๋๋ค.++ 4. ์ฌ์ดํธ ๊ตฌ์กฐ๊ฐ ๋ฐ๋๋ฉด `adaptive`๋ฅผ ์ผ์ ์์๋ฅผ ์ฐพ์ต๋๋ค. Scrapling์ ์ ์ฅํ ํน์ง์ ๋ถ๋ฌ์ ํ์ด์ง์ ๋ชจ๋ ์์์ ๋น๊ตํ๊ณ , ์ํ๋ ์์์์ ์ ์ฌ๋๋ฅผ ๊ณ์ฐํฉ๋๋ค. ์๋์์ ๋ณด๋ฏ ์ฌ๋ฌ ํน์ง์ ๋ชจ๋ ๊ณ ๋ คํฉ๋๋ค.+ 5. ๊ฐ์ฅ ๋น์ทํ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ์ ์๊ฐ ๊ฐ์ ์์๊ฐ ์ฌ๋ฌ ๊ฐ๋ผ๋ฉด ํจ๊ป ๋ฐํํฉ๋๋ค.++### ์์๋ฅผ ๊ตฌ๋ถํ๋ ํน์ง {#the-unique-properties}+์์์ ๋ชจ๋ ์์ฑ์ด ๋ฐ๋๊ฑฐ๋ ์ฌ๋ผ์ง ์ ์๋๋ฐ ์ด๋ค ํน์ง์ ์ ์ฅํ๋์ง ๊ถ๊ธํ ์ ์์ต๋๋ค.++Scrapling์ ๋ค์ ํน์ง์ ์ฌ์ฉํฉ๋๋ค.++- ์์์ ํ๊ทธ ์ด๋ฆ, ํ ์คํธ, ์์ฑ์ ์ด๋ฆ๊ณผ ๊ฐ, ํ์ ์์์ ํ๊ทธ ์ด๋ฆ, ๊ฒฝ๋ก์ ์๋ ํ๊ทธ ์ด๋ฆ.+- ๋ถ๋ชจ ์์์ ํ๊ทธ ์ด๋ฆ, ์์ฑ์ ์ด๋ฆ๊ณผ ๊ฐ, ํ ์คํธ.++์์ ํ ๊ฐ์์ง๋ฅผ ๋น๊ตํ๋ ๊ฒ์ด ์๋๋ผ ๊ฐ์ด ์ผ๋ง๋ ๋น์ทํ์ง๋ฅผ ๋น๊ตํฉ๋๋ค. ๊ฐ์ ์์๋ ๊ณ ๋ คํฉ๋๋ค. ์๋ฅผ ๋ค์ด ๋ณ๊ฒฝ ์ ํ์ ์์์ ํด๋์ค ์ด๋ฆ์ด ์ด๋ค ์์๋ก ์ฐ์๋์ง๋ ๋น๊ตํฉ๋๋ค.++## ์ ์ํ ๊ธฐ๋ฅ ์ฌ์ฉํ๊ธฐ {#how-to-use-adaptive-feature}+์ ์ํ ๊ธฐ๋ฅ์ ์ฐพ์ ๋ชจ๋ ์์์ ์ ์ฉํ ์ ์์ต๋๋ค. ์์์ ๋ณธ ๊ฒ์ฒ๋ผ CSS/XPath ์ ํ ๋ฉ์๋์ ์ธ์๋ก๋ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, ๋ค์์ ๋ค์ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++๋จผ์ [Selector](main_classes.md#selector)๋ฅผ ์ด๊ธฐํํ ๋ `adaptive=True`๋ฅผ ์ ๋ฌํด `adaptive`๋ฅผ ์ผ์ธ์. ๋๋ ์ฌ์ฉํ๋ Fetcher์์ ๊ฐ์ ๊ธฐ๋ฅ์ ์ผ๋ฉด ๋ฉ๋๋ค.++์๋ฅผ ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.+```python+from scrapling import Selector, Fetcher+page = Selector(html_doc, adaptive=True)+# OR+Fetcher.adaptive = True+page = Fetcher.get('https://example.com')+```+[Selector](main_classes.md#selector)๋ฅผ ์ฌ์ฉํ ๋๋ ์ฌ์ดํธ URL์ `url` ์ธ์๋ก ์ ๋ฌํ์ธ์. Scrapling์ด ๊ฐ ์์์ ํน์ง์ ๋๋ฉ์ธ๋ณ๋ก ๊ตฌ๋ถํด์ ์ ์ฅํ ์ ์์ต๋๋ค.++URL์ ์ ๋ฌํ์ง ์์ผ๋ฉด ์์์ ํน์ง์ ์ ์ฅํ ๋ URL ๋์ `default`๋ผ๋ ๊ฐ์ ์ฌ์ฉํฉ๋๋ค. ๋์ค์ ๋ค๋ฅธ ์ฌ์ดํธ์์ ๊ฐ์ ์๋ณ์๋ฅผ ์ฐ๋ฉด์ URL๋ ์ ๋ฌํ์ง ์์ผ๋ฉด ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์์ต๋๋ค. ์ ์ฅํ ๋ ์ด์ ๋ฐ์ดํฐ๋ฅผ ๋ฎ์ด์ฐ๋ฉฐ, `adaptive`๋ ๊ฐ์ฅ ์ต๊ทผ์ ์ ์ฅํ ํน์ง๋ง ์ฌ์ฉํฉ๋๋ค.++`storage`์ `storage_args`๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฐ๊ฒฐ์ ์ค์ ํ๋ ์ธ์์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ ๊ณตํ๋ SQLite ํด๋์ค๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ง์ ์ ์ฅ ์์คํ ์ ๋ง๋ค ๋๋ง ํ์ํ ์ค์ ์ด๋ฉฐ, [๊ฐ๋ฐ ์น์ ์ ๋ณ๋ ํ์ด์ง](../development/adaptive_storage_system.md)์์ ์ค๋ช ํฉ๋๋ค.++์ด์ `adaptive`๋ฅผ ์ ์ฒด ์ค์ ์์ ์ผฐ์ผ๋ฏ๋ก ๋ ๊ฐ์ง ์ฃผ์ ๋ฐฉ๋ฒ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.++### CSS/XPath ์ ํ์ผ๋ก ์ฌ์ฉํ๊ธฐ {#the-cssxpath-selection-way}+์ ์์ฒ๋ผ ํ์ด์ง์ ์์๊ฐ ์์ง ์์ ๋ `auto_save` ์ธ์๋ก ํน์ง์ ์ ์ฅํฉ๋๋ค.+```python+element = page.css('#p1', auto_save=True)+```+์์๊ฐ ๋๋ ์ ํ๋์ง ์์ผ๋ฉด ๊ฐ์ ์ ํ์์ `adaptive` ์ธ์๋ฅผ ์ฌ์ฉํด ๋ค์ ์ฐพ์ ์ ์์ต๋๋ค.+```python+element = page.css('#p1', adaptive=True)+```+๊ฐ๋จํ์ฃ ?++๋ด๋ถ์์๋ ์ฌ๋ฌ ์์ ์ด ์ผ์ด๋ฉ๋๋ค. ์์์ ํน์ง์ ๋ค์ ๋ถ๋ฌ์ค๊ธฐ ์ํด ํ์ํ ์๋ณ์๋ฅผ ๊ธฐ์ตํ์๋์? `css`/`xpath` ๋ฉ์๋๋ ํธ์๋ฅผ ์ํด ์ ๋ฌํ ์ ํ์๋ฅผ ์๋ณ์๋ก ์๋ ์ฌ์ฉํฉ๋๋ค :)++์ด ๋ฉ์๋๋ค์ `identifier` ์ธ์๋ฅผ ์ ๋ฌํ๋ฉด ์๋ณ์๋ฅผ ์ง์ ์ง์ ํ ์๋ ์์ต๋๋ค. `auto_save`๋ก ํน์ง์ ์ ์ฅํ ๋๋ฅผ ๋น๋กฏํด ์ฌ๋ฌ ์ํฉ์์ ์ ์ฉํฉ๋๋ค.++### ์ง์ ์ ์ฅํ๊ณ ์ฐพ๊ธฐ {#the-manual-way}+์์์ ํน์ง์ ์ง์ ์ ์ฅํ๊ณ ๋ถ๋ฌ์จ ๋ค, `adaptive` ๊ธฐ๋ฅ์ผ๋ก ์์๋ฅผ ๋ค์ ์ฐพ์ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ์ด๋ค ๋ฐฉ๋ฒ์ผ๋ก ์ ํํ ์์๋ผ๋ ๋ค์ ์ฐพ์ ์ ์์ต๋๋ค.++๋จผ์ ํ ์คํธ๋ก ์์๋ฅผ ์ฐพ์๋ค๊ณ ๊ฐ์ ํ๊ฒ ์ต๋๋ค.+```python+element = page.find_by_text('Tipping the Velvet', first_match=True)+```+`save` ๋ฉ์๋๋ก ํน์ง์ ์ ์ฅํ ์ ์์ต๋๋ค. ์ด๋๋ ์๋ณ์๋ฅผ ์ง์ ์ง์ ํด์ผ ํฉ๋๋ค. ์์์๋ `my_special_element`๋ฅผ ์ฌ์ฉํ์ง๋ง, ์ค์ ์ฝ๋์์๋ ๋ณ์ ์ด๋ฆ์ฒ๋ผ ์๋ฏธ๊ฐ ๋ถ๋ช ํ ์ด๋ฆ์ ์ฐ๋ ๊ฒ์ด ์ข์ต๋๋ค :)+```python+page.save(element, 'my_special_element')+```+๋์ค์ ํน์ง์ ๋ถ๋ฌ์ `adaptive`๋ก ํ์ด์ง์์ ์์๋ฅผ ๋ค์ ์ฐพ์ผ๋ ค๋ฉด ๋ค์์ฒ๋ผ ์์ฑํฉ๋๋ค.+```python+>>> element_dict = page.retrieve('my_special_element')+>>> page.relocate(element_dict, selector_type=True)+[<data='<a href="catalogue/tipping-the-velvet_99...' parent='<h3><a href="catalogue/tipping-the-velve...'>]+>>> page.relocate(element_dict, selector_type=True).css('::text').getall()+['Tipping the Velvet']+```+์ฌ๊ธฐ์๋ `retrieve`์ `relocate` ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.++๊ฒฐ๊ณผ๋ฅผ `lxml.etree` ๊ฐ์ฒด๋ก ์ ์งํ๋ ค๋ฉด `selector_type` ์ธ์๋ฅผ ์๋ตํ์ธ์.+```python+>>> page.relocate(element_dict)+[<Element a at 0x105a2a7b0>]+```++## ๋ฌธ์ ํด๊ฒฐ {#troubleshooting}++### ์ผ์นํ๋ ์์๊ฐ ์์ ๋ {#no-matches-found}+```python+# 1. Check if data was saved+element_data = page.retrieve('identifier')+if not element_data:+ print("No data saved for this identifier")++# 2. Try with different identifier+products = page.css('.product', adaptive=True, identifier='old_selector')++# 3. Save again with new identifier+products = page.css('.new-product', auto_save=True, identifier='new_identifier')+```++### ๋ค๋ฅธ ์์๊ฐ ์ ํ๋ ๋ {#wrong-elements-matched}+```python+# Use more specific selectors+products = page.css('.product-list .product', auto_save=True)++# Or save with more context+product = page.find_by_text('Product Name').parent+page.save(product, 'specific_product')+```++## ์๋ ค์ง ์ ํ ์ฌํญ {#known-issues}+`adaptive`๋ก ์ ์ฅํ ๋๋ ์ ํ ๊ฒฐ๊ณผ์ ์ฒซ ๋ฒ์งธ ์์์ ๋ํ ํน์ง๋ง ์ ์ฅํฉ๋๋ค. ์ ํ์๊ฐ ํ์ด์ง์ ์ฌ๋ฌ ์์น์์ ๋ค๋ฅธ ์์๋ค์ ์ ํํ๋๋ผ๋, ๋์ค์ `adaptive`๋ก ๋ค์ ์ฐพ์ผ๋ฉด ์ฒซ ๋ฒ์งธ ์์๋ง ๋ฐํํฉ๋๋ค. ์ผํ๋ก ๋ฌถ์ CSS ์ ํ์๋ ์์ธ์ ๋๋ค. ๊ฐ ์ ํ์๋ฅผ ๋ถ๋ฆฌํด ๋ฐ๋ก ์คํํ๊ธฐ ๋๋ฌธ์ ๋๋ค.++## ๋ง๋ฌด๋ฆฌ {#final-thoughts}+์ด ๊ธฐ๋ฅ์ ์ฝ๊ณ ์์ธํ๊ฒ ์ค๋ช ํ๊ธฐ๊ฐ ์๊ฐ๋ณด๋ค ์ด๋ ค์ ์ต๋๋ค. ์์ง ๊ถ๊ธํ ์ ์ด ์๋ค๋ฉด [ํ ๋ก ๊ฒ์ํ](https://github.com/D4Vinci/Scrapling/discussions), Discord ์๋ฒ ๋๋ ๊ฐ์ธ ๋ฉ์์ง๋ก ์๋ ค์ฃผ์ธ์. ๊ฐ๋ฅํ ํ ๋นจ๋ฆฌ ๋ตํ๊ฒ ์ต๋๋ค :)\ No newline at end of filediff --git a/docs/locales/ko/parsing/main_classes.md b/docs/locales/ko/parsing/main_classes.mdnew file mode 100644index 0000000..c9f0249--- /dev/null+++ b/docs/locales/ko/parsing/main_classes.md@@ -0,0 +1,575 @@+---+title: "Scrapling์ Selector์ Selectors: ๋ฐ์ดํฐ์ ํ์"+description: "Selector์ Selectors๊ฐ HTML, ํ ์คํธ, ์์ฑ์ ์ ์ฅํ๋ ๋ฐฉ์์ ์์๋ด ๋๋ค. ๊ฐ์ ์ถ์ถํ๊ณ URL์ ์์ฑํ๋ฉฐ ๋ถ๋ชจ, ์์, ํ์ ์์๋ฅผ ํ์ํ์ธ์."+---++# ํ์ฑ์ ์ฃผ์ ํด๋์ค {#parsing-main-classes}++!!! success "์ฌ์ ์ค๋น"++ - [์์ ์ฐพ๊ธฐ](../parsing/selection.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector) ๊ฐ์ฒด์์ ์์๋ฅผ ์ฐพ๊ณ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.++Scrapling์์ ์์๋ฅผ ์ ํํ๋ ์ฌ๋ฌ ๋ฐฉ๋ฒ์ ์ดํด๋ดค์ต๋๋ค. ์ด์ [Selector](#selector) ํด๋์ค์ ๊ด๋ จ ๊ฐ์ฒด๋ฅผ ์ดํด๋ณด๋ฉฐ ํ์๊ฐ ์ด๋ป๊ฒ ์๋ํ๋์ง ์์๋ณด๊ฒ ์ต๋๋ค.++[Selector](#selector)๋ HTML ํ์ฑ๊ณผ ์์ ์ ํ์ ๋ด๋นํ๋ Scrapling์ ํต์ฌ ํด๋์ค์ ๋๋ค. ๋ค์ ์ค ์ด๋ ๋ฐฉ์์ผ๋ก๋ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.+```python+from scrapling import Selector+from scrapling.parser import Selector+```+๊ทธ๋ฐ ๋ค์ [๊ฐ์](../overview.md)์์ ๋ฐฐ์ด ๊ฒ์ฒ๋ผ ๋ฐ๋ก ์ฌ์ฉํฉ๋๋ค.+```python+page = Selector(+ '<html>...</html>',+ url='https://example.com'+)++# Then select elements as you like+elements = page.css('.product')+```+HTML์ ์ ๋ฌํ๊ฑฐ๋ ์ฌ์ดํธ๋ฅผ ๊ฐ์ ธ์จ ๋ค ์ฃผ๋ก ๋ค๋ฃจ๋ ๊ฐ์ฒด๋ [Selector](#selector)์ ๋๋ค. ์ ํ์ด๋ ํ์ ๋ฑ์ ์์ ๊ฒฐ๊ณผ๊ฐ ํ ์คํธ๊ฐ ์๋๋ผ ํ์ด์ง์ ์์๋ผ๋ฉด, [Selector](#selector) ๋๋ [Selectors](#selectors) ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค.++ํ์ด์ง ์์ฒด๋ [Selector](#selector) ๊ฐ์ฒด์ด๊ณ , ๊ทธ ์์ ์์๋ค๋ [Selector](#selector) ๊ฐ์ฒด์ ๋๋ค. ์์์ ๋ด์ฉ์ด๋ ์์ฑ๊ฐ ๊ฐ์ ํ ์คํธ๋ [TextHandler](#texthandler) ๊ฐ์ฒด์ด๋ฉฐ, ๊ฐ ์์์ ์์ฑ์ [AttributesHandler](#attributeshandler)์ ์ ์ฅ๋ฉ๋๋ค. ์ด ๋ ๊ฐ์ฒด๋ ๋ค์์ ์ค๋ช ํ๊ณ , ๋จผ์ [Selector](#selector)๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++## Selector {#selector}+### ์ธ์ ์ค๋ช {#arguments-explained}+๊ฐ์ฅ ์ค์ํ ์ธ์๋ `content`์ ๋๋ค. ํ์ฑํ HTML์ `str` ๋๋ `bytes`๋ก ์ ๋ฌํฉ๋๋ค.++`url`์ ์๋ ๋งํฌ๋ฅผ ์์ฑํ๊ณ ์ ์ฅ๋ ์ ์ํ ๋ฐ์ดํฐ๋ฅผ ๋๋ฉ์ธ๋ณ๋ก ๋๋ ๋ ์ฌ์ฉํ๋ ํ์ด์ง URL์ ๋๋ค. `adaptive`, `storage`, `storage_args`๋ [์ ์ํ ๊ธฐ๋ฅ](adaptive.md)์ ์ค์ ์ด๋ฉฐ, ์ด ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ง ์์ผ๋ฉด ์ํฅ์ ์ฃผ์ง ์์ต๋๋ค.++HTML ํ์ฑ๊ณผ ์ฒ๋ฆฌ ๋ฐฉ์์ ๋ฐ๊พธ๋ ์ธ์๋ ์์ต๋๋ค.++- **encoding**: HTML์ ํ์ฑํ ๋ ์ฌ์ฉํ ์ธ์ฝ๋ฉ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `UTF-8`์ ๋๋ค.+- **keep_comments**: ํ์ฑํ ๋ HTML ์ฃผ์์ ์ ์งํ ์ง ์ ํฉ๋๋ค. ์ฃผ์์ด ์คํฌ๋ํ์ ๋ฌธ์ ๋ฅผ ์ผ์ผํฌ ์ ์์ด ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค.++์ค๋ช ์ ๋๋ฌด ๋ณต์กํ๊ฒ ๋ง๋ค์ง ์๊ธฐ ์ํด `huge_tree`์ `root`๋ ์ฌ๊ธฐ์ ๋ค๋ฃจ์ง ์์ต๋๋ค.+๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด ๊ผญ ์ ํ์๋ ์๋ ๊ณ ๊ธ ๊ธฐ๋ฅ์ ์ข ์ข ์ด๋ ๊ฒ ์๋ตํฉ๋๋ค. ์์ธํ ์๊ณ ์ถ๋ค๋ฉด ๊ฐ๋ฐ ์น์ ์ ์ฐธ๊ณ ํ์ธ์.++ํ์ด์ง์ ์์์ ์์ฑ์ ๋๋ถ๋ถ ํ์ํ ๋๋ง ๊ณ์ฐํฉ๋๋ค. ์๋ฅผ ๋ค์ด ํ ์คํธ ๋ด์ฉ์ ์ค์ ๋ก ์ ๊ทผํ ๋ ์ด๊ธฐํํฉ๋๋ค. ์ด๊ฒ๋ Scrapling์ด ๋น ๋ฅธ ์ด์ ์ค ํ๋์ ๋๋ค :)++### ์์ฑ {#properties}+[๊ฐ์](../overview.md)์์ ์ด๋ฏธ ๋ณธ ๋ด์ฉ๋ ์์ง๋ง, ์ฌ๊ธฐ์๋ ๋ ์์ธํ ์ฌ์ฉ๋ฒ์ ์ดํด๋ด ๋๋ค. ์์ ์ฌ์ด๋ฅผ ์ด๋ํ๋ ์์ฑ์ ์๋ [ํ์](#traversal) ์น์ ์ ๋ฐ๋ก ์ ๋ฆฌํ์ต๋๋ค.++๋ค์ HTML ํ์ด์ง๋ฅผ ์๋ก ์ฌ์ฉํ๊ฒ ์ต๋๋ค.+```html+<html>+ <head>+ <title>Some page</title>+ </head>+ <body>+ <div class="product-list">+ <article class="product" data-id="1">+ <h3>Product 1</h3>+ <p class="description">This is product 1</p>+ <span class="price">$10.99</span>+ <div class="hidden stock">In stock: 5</div>+ </article>++ <article class="product" data-id="2">+ <h3>Product 2</h3>+ <p class="description">This is product 2</p>+ <span class="price">$20.99</span>+ <div class="hidden stock">In stock: 3</div>+ </article>++ <article class="product" data-id="3">+ <h3>Product 3</h3>+ <p class="description">This is product 3</p>+ <span class="price">$15.99</span>+ <div class="hidden stock">Out of stock</div>+ </article>+ </div>++ <script id="page-data" type="application/json">+ {+ "lastUpdated": "2024-09-22T10:30:00Z",+ "totalProducts": 3+ }+ </script>+ </body>+</html>+```+์์ ๋ณธ ๋ฐฉ๋ฒ์ผ๋ก ํ์ด์ง๋ฅผ ๋ถ๋ฌ์ต๋๋ค.+```python+from scrapling import Selector+page = Selector(html_doc)+```+์ค์ฒฉ๋ ์์๊น์ง ํฌํจํด ํ์ด์ง์ ๋ชจ๋ ํ ์คํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> page.get_all_text()+'Some page\n\n \n\n \nProduct 1\nThis is product 1\n$10.99\nIn stock: 5\nProduct 2\nThis is product 2\n$20.99\nIn stock: 3\nProduct 3\nThis is product 3\n$15.99\nOut of stock'+```+์ฒซ ๋ฒ์งธ article ์์๋ฅผ ๊ฐ์ ธ์ ์๋ก ์ฌ์ฉํ๊ฒ ์ต๋๋ค.+```python+article = page.find('article')+```+๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ์์ ์์ ๋ชจ๋ ํ ์คํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.get_all_text()+'Product 1\nThis is product 1\n$10.99\nIn stock: 5'+```+ํ์ง๋ง ์์์ ์ง์ ๋ค์ด ์๋ ํ ์คํธ๋ง ์์ฒญํ๋ฉด ๋น ๊ฐ์ด ๋์ต๋๋ค. ์ HTML์์ ์ด ์์์๋ ์ง์ ์์ฑ๋ ํ ์คํธ๊ฐ ์๊ธฐ ๋๋ฌธ์ ๋๋ค.+```python+>>> article.text+''+```+`get_all_text`์๋ ๋ค์๊ณผ ๊ฐ์ ์ ํ์ ์ธ์๊ฐ ์์ต๋๋ค.++1. **separator**: ์ฐพ์ ๋ฌธ์์ด์ ํฉ์น ๋ ์ฌ์ฉํ๋ ๊ตฌ๋ถ์์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ '\n'์ ๋๋ค.+2. **strip**: ํฉ์น๊ธฐ ์ ์ ๊ฐ ๋ฌธ์์ด์ ์ ๋ ๊ณต๋ฐฑ์ ์ ๊ฑฐํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค.+3. **ignore_tags**: ๊ฒฐ๊ณผ์์ ์ ์ธํ ํ๊ทธ ์ด๋ฆ์ ํํ์ ๋๋ค. ํด๋น ํ๊ทธ ์์ ์ค์ฒฉ ์์๋ ์ ์ธํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `('script', 'style',)`์ ๋๋ค.+4. **valid_values**: ๊ฐ์ด ์๋ ์์๋ง ์์งํฉ๋๋ค. ํ ์คํธ๊ฐ ๋น์ด ์๊ฑฐ๋ ๊ณต๋ฐฑ๋ง ์๋ ์์๋ ์ ์ธํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.++์ฌ๊ธฐ์ ๋ฐํํ๋ ํ ์คํธ๋ ์ผ๋ฐ ๋ฌธ์์ด์ด ์๋๋ผ [TextHandler](#texthandler)์ ๋๋ค. ๋ค์์ ์์ธํ ์ค๋ช ํ๊ฒ ์ต๋๋ค. ๋ด์ฉ์ด JSON์ด๋ผ๋ฉด `.json()`์ผ๋ก ๋ณํํ ์ ์์ต๋๋ค.+```python+>>> script = page.find('script')+>>> script.json()+{'lastUpdated': '2024-09-22T10:30:00Z', 'totalProducts': 3}+```+์ด์ ์์์ ํ๊ทธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.tag+'article'+```+ํ์ด์ง์ ์ง์ ์ฌ์ฉํ๋ฉด ๋ฃจํธ `html` ์์๋ฅผ ๋ค๋ฃจ๊ณ ์๋ค๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค.+```python+>>> page.tag+'html'+```+์ด์ `page`์ `element`์ ๊ด๊ณ๋ ์ถฉ๋ถํ ์ค๋ช ํ์ผ๋ ๋ค์ ๋ค๋ฃจ์ง ์๊ฒ ์ต๋๋ค.++์์์ ์์ฑ์ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> print(article.attrib)+{'class': 'product', 'data-id': '1'}+```+ํน์ ์์ฑ์ ๋ค์ ์ค ์ด๋ ๋ฐฉ๋ฒ์ผ๋ก๋ ์ฝ์ ์ ์์ต๋๋ค.+```python+article.attrib['class']+article.attrib.get('class')+article['class'] # new in v0.3+```+ํน์ ์์ฑ์ด ์๋์ง๋ ๋ค์์ฒ๋ผ ํ์ธํฉ๋๋ค.+```python+'class' in article.attrib+'class' in article # new in v0.3+```+์์์ HTML ๋ด์ฉ์ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.html_content+'<article class="product" data-id="1"><h3>Product 1</h3>\n <p class="description">This is product 1</p>\n <span class="price">$10.99</span>\n <div class="hidden stock">In stock: 5</div>\n </article>'+```+๋ณด๊ธฐ ์ข๊ฒ ์ ๋ฆฌํ HTML์ ๊ฐ์ ธ์ต๋๋ค.+```python+print(article.prettify())+```+```html+<article class="product" data-id="1"><h3>Product 1</h3>+ <p class="description">This is product 1</p>+ <span class="price">$10.99</span>+ <div class="hidden stock">In stock: 5</div>+</article>+```+`.body` ์์ฑ์ ํ์ด์ง์ ์๋ณธ ๋ด์ฉ์ ๋ฐํํฉ๋๋ค. v0.4๋ถํฐ Fetcher๊ฐ ๋ฐํํ๋ `Response` ๊ฐ์ฒด์ `.body`๋ ํญ์ `bytes`์ ๋๋ค.+```python+>>> page.body+'<html>\n <head>\n <title>Some page</title>\n </head>\n ...'+```+DOM ํธ๋ฆฌ์์ ์ด ์์์ ๋ชจ๋ ์กฐ์์ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.path+[<data='<div class="product-list"> <article clas...' parent='<body> <div class="product-list"> <artic...'>,+ <data='<body> <div class="product-list"> <artic...' parent='<html><head><title>Some page</title></he...'>,+ <data='<html><head><title>Some page</title></he...'>]+```+๊ฐ๋ฅํ๋ฉด ์งง์ CSS ์ ํ์๋ฅผ ๋ง๋ค๊ณ , ๊ทธ๋ ์ง ์์ผ๋ฉด ์ ์ฒด ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.+```python+>>> article.generate_css_selector+'body > div > article'+>>> article.generate_full_css_selector+'body > div > article'+```+XPath๋ ๊ฐ์ ๋ฐฉ์์ ๋๋ค.+```python+>>> article.generate_xpath_selector+"//body/div/article"+>>> article.generate_full_xpath_selector+"//body/div/article"+```++### ํ์ {#traversal}+์์์ ์ฐพ์ ์์๋ฅผ ์ฌ์ฉํด ํ์ด์ง ์์์ ์ด๋ํ๋ ์์ฑ๊ณผ ๋ฉ์๋๋ฅผ ์์ธํ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++DOM ํธ๋ฆฌ๋ ํธ๋ฆฌ ์๋ฃ๊ตฌ์กฐ๊ฐ ์ต์ํ์ง ์์ผ๋ฉด ์ด ๋ถ๋ถ์ด ์ด๋ ค์ธ ์ ์์ต๋๋ค. ๋จผ์ ํด๋น ๊ฐ๋ ์ ์ฐพ์๋ณด๋ฉด ๋์์ด ๋ฉ๋๋ค.++๋ฐ๋ก ์ด์ด์ ์ฝ๊ณ ์ถ๋ค๋ฉด ๋ค์์ ์งง์ ์ค๋ช ์ ์ฐธ๊ณ ํ์ธ์.<br/>+`html` ์์๋ ์ฌ์ดํธ ํธ๋ฆฌ์ ๋ฃจํธ์ ๋๋ค. ๋ชจ๋ ํ์ด์ง๊ฐ `html` ์์๋ก ์์ํ๊ธฐ ๋๋ฌธ์ ๋๋ค.<br/>+๊ทธ ๋ฐ๋ก ์๋์๋ `head`์ `body` ๊ฐ์ ์์๊ฐ ์์ต๋๋ค. ์ด๋ค์ `html`์ ์์์ด๋ฉฐ, `html`์ ์ด๋ค์ ๋ถ๋ชจ์ ๋๋ค. `body`์ `head`๋ ๋ถ๋ชจ๊ฐ ๊ฐ์ผ๋ฏ๋ก ์๋ก ํ์ ์์์ ๋๋ค.++์์์ ๋ถ๋ชจ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.parent+<data='<div class="product-list"> <article clas...' parent='<body> <div class="product-list"> <artic...'>+>>> article.parent.tag+'div'+```+์ด๋ฐ ์ ๊ทผ์ ์ํ๋ ๋งํผ ์ด์ด์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋์์ ๋ค๋ฃฐ ๋น์ทํ ์์ฑ๊ณผ ๋ฉ์๋์๋ ์ ์ฉ๋ฉ๋๋ค.+```python+>>> article.parent.parent.tag+'body'+```+์์์ ์์์ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.children+[<data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>,+ <data='<p class="description">This is product 1...' parent='<article class="product" data-id="1"><h3...'>,+ <data='<span class="price">$10.99</span>' parent='<article class="product" data-id="1"><h3...'>,+ <data='<div class="hidden stock">In stock: 5</d...' parent='<article class="product" data-id="1"><h3...'>]+```+์์ ์๋์ ๋ชจ๋ ์ค์ฒฉ ์์๋ฅผ ๊ฐ์ ธ์ต๋๋ค. `children`์ ๋ชจ๋ ๊น์ด์ ์ ์ฉํ๋ ๊ฒ๊ณผ ๋น์ทํฉ๋๋ค.+```python+>>> article.below_elements+[<data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>,+ <data='<p class="description">This is product 1...' parent='<article class="product" data-id="1"><h3...'>,+ <data='<span class="price">$10.99</span>' parent='<article class="product" data-id="1"><h3...'>,+ <data='<div class="hidden stock">In stock: 5</d...' parent='<article class="product" data-id="1"><h3...'>]+```+์ด ์์์๋ ์์์๊ฒ ๋ค๋ฅธ ์์์ด ์์ผ๋ฏ๋ก `children`๊ณผ ๊ฒฐ๊ณผ๊ฐ ๊ฐ์ต๋๋ค.++`product-list` ํด๋์ค๊ฐ ์๋ ์์๋ฅผ ๋ณด๋ฉด `children`๊ณผ `below_elements`์ ์ฐจ์ด๊ฐ ๋ ๋ถ๋ช ํด์ง๋๋ค.+```python+>>> products_list = page.css('.product-list')[0]+>>> products_list.children+[<data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>,+ <data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>,+ <data='<article class="product" data-id="3"><h3...' parent='<div class="product-list"> <article clas...'>]++>>> products_list.below_elements+[<data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>,+ <data='<h3>Product 1</h3>' parent='<article class="product" data-id="1"><h3...'>,+ <data='<p class="description">This is product 1...' parent='<article class="product" data-id="1"><h3...'>,+ <data='<span class="price">$10.99</span>' parent='<article class="product" data-id="1"><h3...'>,+ <data='<div class="hidden stock">In stock: 5</d...' parent='<article class="product" data-id="1"><h3...'>,+ <data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>,+...]+```+์์์ ํ์ ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.siblings+[<data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>,+ <data='<article class="product" data-id="3"><h3...' parent='<div class="product-list"> <article clas...'>]+```+ํ์ฌ ์์์ ๋ค์ ํ์ ์์๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> article.next+<data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>+```+`previous`๋ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋์ํฉ๋๋ค.+```python+>>> article.previous # It's the first child, so it doesn't have a previous element+>>> second_article = page.css('.product[data-id="2"]')[0]+>>> second_article.previous+<data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>+```+์์์ ํน์ ํด๋์ค๊ฐ ์๋์ง ๋น ๋ฅด๊ณ ์ฝ๊ฒ ํ์ธํ ์ ์์ต๋๋ค.+```python+>>> article.has_class('product')+True+```+๋ถ๋ชจ ํ๋๋ก ์ถฉ๋ถํ์ง ์๋ค๋ฉด ๋ชจ๋ ์กฐ์์ ์์๋๋ก ์ดํด๋ณผ ์ ์์ต๋๋ค.+```python+for ancestor in article.iterancestors():+ # do something with it...+```+์กฐ๊ฑด์ ๋ง๋ ํน์ ์กฐ์์ ์ฐพ์ ์๋ ์์ต๋๋ค. [Selector](#selector) ๊ฐ์ฒด๋ฅผ ๋ฐ๊ณ ์กฐ๊ฑด์ด ๋ง์ผ๋ฉด `True`, ์๋๋ฉด `False`๋ฅผ ๋ฐํํ๋ ํจ์๋ฅผ ์ ๋ฌํ์ธ์.+```python+>>> article.find_ancestor(lambda ancestor: ancestor.has_class('product-list'))+<data='<div class="product-list"> <article clas...' parent='<body> <div class="product-list"> <artic...'>++>>> article.find_ancestor(lambda ancestor: ancestor.css('.product-list')) # Same result, different approach+<data='<div class="product-list"> <article clas...' parent='<body> <div class="product-list"> <artic...'>+```+## Selectors {#selectors}+`Selectors`๋ [Selector](#selector) ๊ฐ์ฒด๋ฅผ ๋ด๋ ๋ฆฌ์คํธ์ ๋๋ค. Python์ ํ์ค `List`๋ฅผ ์์ํ๋ฏ๋ก ๋ชจ๋ `List` ์์ฑ๊ณผ ๋ฉ์๋๋ฅผ ์ง์ํฉ๋๋ค. ์ฌ๊ธฐ์ ๋ด๋ถ์ [Selector](#selector) ๊ฐ์ฒด๋ฅผ ๋ ์ฝ๊ฒ ๋ค๋ฃฐ ์ ์๋ ๋ฉ์๋๋ฅผ ์ถ๊ฐํ์ต๋๋ค.++[Selector](#selector)์ ๋ฉ์๋์ ์์ฑ์ด ์ฌ๋ฌ ์์๋ฅผ ๋ฐํํ ๋๋ [Selectors](#selectors) ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํฉ๋๋ค.++v0.4๋ถํฐ ๋ชจ๋ ์ ํ ๋ฉ์๋๋ ํ ์คํธ ๋ ธ๋์ ์์ฑ๊ฐ์๋ [Selector](#selector)/[Selectors](#selectors) ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค. `::text`, `/text()`, `::attr()`, `/@attr`๋ก ์ ํํ ํ ์คํธ ๋ ธ๋๋ [Selector](#selector)๋ก ๊ฐ์๋๋ค. ์ด ๊ฐ์ฒด์ `tag`๋ `"#text"`์ด๋ฉฐ, `text` ์์ฑ์ ํ ์คํธ๊ฐ์ ๋ฐํํฉ๋๋ค. ํ ์คํธ๋ ์ง์ ์ฝ์ ์ ์๊ณ , ๋ค๋ฅธ ์์ฑ์ ๋น ๊ฐ์ด๋ ๊ธฐ๋ณธ๊ฐ์ ๋ฐํํฉ๋๋ค.++```python+page.css('a::text') # -> Selectors (of text node Selectors)+page.xpath('//a/text()') # -> Selectors+page.css('a::text').get() # -> TextHandler (the first text value)+page.css('a::text').getall() # -> TextHandlers (all text values)+page.css('a::attr(href)') # -> Selectors+page.xpath('//a/@href') # -> Selectors+page.css('.price_color') # -> Selectors+```++### ๋ฐ์ดํฐ ์ถ์ถ ๋ฉ์๋ {#data-extraction-methods}+v0.4๋ถํฐ [Selector](#selector)์ [Selectors](#selectors)๋ ๋ชจ๋ `get()`, `getall()`๊ณผ ๋ณ์นญ์ธ `extract_first`, `extract`๋ฅผ ์ ๊ณตํฉ๋๋ค. Scrapy์ ๋ฐฉ์์ ๋ฐ๋ฆ ๋๋ค. ์ด์ ์ `get_all()`์ ์ ๊ฑฐ๋์์ต๋๋ค.++**[Selector](#selector) ๊ฐ์ฒด์์๋ ๋ค์๊ณผ ๊ฐ์ด ๋์ํฉ๋๋ค.**++- `get()`์ `TextHandler`๋ฅผ ๋ฐํํฉ๋๋ค. ํ ์คํธ ๋ ธ๋๋ผ๋ฉด ํ ์คํธ๊ฐ์, HTML ์์๋ผ๋ฉด ๋ฐ๊นฅ ํ๊ทธ๋ฅผ ํฌํจํ HTML ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค.+- `getall()`์ ํด๋น ๋ฌธ์์ด ํ๋๋ฅผ ๋ด์ `TextHandlers` ๋ฆฌ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.+- `extract_first`๋ `get()`์ ๋ณ์นญ์ด๊ณ , `extract`๋ `getall()`์ ๋ณ์นญ์ ๋๋ค.++```python+>>> page.css('h3')[0].get() # Outer HTML of the element+'<h3>Product 1</h3>'++>>> page.css('h3::text')[0].get() # Text value of the text node+'Product 1'+```++**[Selectors](#selectors) ๊ฐ์ฒด์์๋ ๋ค์๊ณผ ๊ฐ์ด ๋์ํฉ๋๋ค.**++- `get(default=None)`์ **์ฒซ ๋ฒ์งธ** ์์์ ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค. ๋ฆฌ์คํธ๊ฐ ๋น์ด ์์ผ๋ฉด `default`๋ฅผ ๋ฐํํฉ๋๋ค.+- `getall()`์ **๋ชจ๋ ** ์์๋ฅผ ๋ฌธ์์ด๋ก ๋ณํํด `TextHandlers` ๋ฆฌ์คํธ๋ก ๋ฐํํฉ๋๋ค.+- `extract_first`๋ `get()`์ ๋ณ์นญ์ด๊ณ , `extract`๋ `getall()`์ ๋ณ์นญ์ ๋๋ค.++```python+>>> page.css('.price::text').get() # First price text+'$10.99'++>>> page.css('.price::text').getall() # All price texts+['$10.99', '$20.99', '$15.99']++>>> page.css('.price::text').get('') # With default value+'$10.99'+```++์ด ๋ฉ์๋๋ CSS, XPath, `find` ๋ฑ ๋ชจ๋ ์ ํ ๋ฐฉ๋ฒ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค. Scrapy์ ํธํ๋๋ ๋ฐฉ์์ผ๋ก ํ ์คํธ์ ์์ฑ๊ฐ์ ์ถ์ถํ ๋ ๊ถ์ฅํฉ๋๋ค.++์ด์ [Selectors](#selectors)๊ฐ ์ ๊ณตํ๋ ๋ค๋ฅธ ๊ธฐ๋ฅ์ ์ดํด๋ณด๊ฒ ์ต๋๋ค.+### ์์ฑ {#properties_1}+๋ฐ๋ณต๊ณผ ์ฌ๋ผ์ด์ฑ ๊ฐ์ Python ๋ฆฌ์คํธ์ ๊ธฐ๋ณธ ์ฐ์ฐ ์ธ์๋ ๋ค์ ์์ ์ ํ ์ ์์ต๋๋ค.++++๋ฆฌ์คํธ ์์ [Selector](#selector) ๊ฐ์ฒด์ CSS์ XPath ์ ํ์๋ฅผ ๋ฐ๋ก ์คํํ ์ ์์ต๋๋ค. ๋ฐํ ํ์ ์ [Selector](#selector)์ `css`, `xpath` ๋ฉ์๋์ ๊ฐ์ต๋๋ค. ์ธ์๋ ๊ฐ์ง๋ง ์ฌ๊ธฐ์๋ `adaptive`๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ ๋ฉ์๋๋ฅผ ์ฝ๊ฒ ์ด์ด์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+```pycon+>>> page.css('.product h3::text').getall()+['Product 1', 'Product 2', 'Product 3']+>>> page.css('.product').css('h3::text').getall()+['Product 1', 'Product 2', 'Product 3']+```+`re`์ `re_first`๋ ๋ฐ๋ก ์คํํ ์ ์์ต๋๋ค. [Selector](#selector)์ ๊ฐ์ ์ธ์๋ฅผ ๋ฐ์ต๋๋ค. ์ด ๋ฉ์๋๋ค์ ์๋ [TextHandler](#texthandler) ์น์ ์์ ์ค๋ช ํฉ๋๋ค.++๋ค๋ง ์ฌ๊ธฐ์ `re_first`๋ ๊ฐ [Selector](#selector)์ `re`๋ฅผ ์คํํ๊ณ , ๊ฒฐ๊ณผ๊ฐ ์๋ ์ฒซ ๋ฒ์งธ ํญ๋ชฉ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค. `re`๋ ์ฌ๋ฌ [TextHandler](#texthandler)๋ฅผ ํ๋์ [TextHandlers](#texthandlers)๋ก ํฉ์น [TextHandlers](#texthandlers) ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค.+```pycon+>>> page.css('.price::text').re(r'[\d.]+')+['10.99', '20.99', '15.99']+>>> page.css('.product h3::text').re(r'Product (\d+)')+['1', '2', '3']+```+`search`๋ก ๋ฆฌ์คํธ ์์ [Selector](#selector)๋ฅผ ๋น ๋ฅด๊ฒ ๊ฒ์ํ ์ ์์ต๋๋ค. ์ ๋ฌํ ํจ์๋ ์ฒซ ๋ฒ์งธ ์ธ์๋ก [Selector](#selector)๋ฅผ ๋ฐ๊ณ True/False๋ฅผ ๋ฐํํด์ผ ํฉ๋๋ค. ๋ฉ์๋๋ ์กฐ๊ฑด์ ๋ง๋ ์ฒซ ๋ฒ์งธ [Selector](#selector)๋ฅผ ๋ฐํํ๋ฉฐ, ์์ผ๋ฉด `None`์ ๋ฐํํฉ๋๋ค.++```pycon+>>> product = page.css('.product').search(lambda p: p.css('.price::text').get() == '$20.99')+>>> product.css('h3::text').get()+'Product 2'+```+`filter`๋ `search`์ฒ๋ผ ํจ์๋ฅผ ๋ฐ์ง๋ง, ์กฐ๊ฑด์ ๋ง๋ ๋ชจ๋ [Selector](#selector)๋ฅผ ๋ด์ `Selectors`๋ฅผ ๋ฐํํฉ๋๋ค.++```pycon+>>> products = page.css('.product').filter(lambda p: float(p.css('.price::text').re_first(r'[\d.]+')) > 15)+>>> products.css('h3::text').getall()+['Product 2', 'Product 3']+```+์ธ๋ฑ์ค ์ค๋ฅ ๊ฑฑ์ ์์ด ์ฒซ ๋ฒ์งธ๋ ๋ง์ง๋ง ์์์ ์์ ํ๊ฒ ์ ๊ทผํ ์ ์์ต๋๋ค.+```python+>>> page.css('.product').first # First Selector or None+<data='<article class="product" data-id="1"><h3...'>+>>> page.css('.product').last # Last Selector or None+<data='<article class="product" data-id="3"><h3...'>+>>> page.css('.nonexistent').first # Returns None instead of raising IndexError+```++[Selectors](#selectors) ์์ ์๋ [Selector](#selector)์ ๊ฐ์๋ฅผ ์งง๊ฒ ์ฐ๊ณ ์ถ๋ค๋ฉด ๋ค์์ฒ๋ผ ํ ์ ์์ต๋๋ค.+```python+page.css('.product').length+```+๋ค์ ์ฝ๋์ ๊ฐ์ต๋๋ค.+```python+len(page.css('.product'))+```+๋ค, JavaScript์ ๋น์ทํ์ฃ :)++## TextHandler {#texthandler}+์ด ํด๋์ค๋ ๊ผญ ์์๋์ธ์. ๋ฌธ์์ด์ ๋ฐํํ๋ ๋ชจ๋ ๋ฉ์๋์ ์์ฑ์ `TextHandler`๋ฅผ ๋ฐํํ๋ฉฐ, ๋ฌธ์์ด ๋ฆฌ์คํธ๋ฅผ ๋ฐํํ๋ ๊ฒฝ์ฐ์๋ [TextHandlers](#texthandlers)๋ฅผ ์ฌ์ฉํฉ๋๋ค.++TextHandler๋ Python์ ํ์ค ๋ฌธ์์ด์ ์์ํ๋ฏ๋ก ์ผ๋ฐ ๋ฌธ์์ด๋ก ํ ์ ์๋ ์์ ์ ๋ชจ๋ ์ง์ํฉ๋๋ค. ๊ทธ๋ ๋ค๋ฉด ์ ๋ค๋ฅธ ์ด๋ฆ์ ์ธ๊น์?++TextHandler๋ ์ผ๋ฐ ๋ฌธ์์ด์ ์๋ ๋ฉ์๋์ ์์ฑ์ ์ถ๊ฐํฉ๋๋ค. ๋ชจ๋ ํด๋์ค์์ ๋ฌธ์์ด์ ๋ฐํํ ๋ TextHandler๋ฅผ ์ฌ์ฉํ๋ฏ๋ก, ์ด๋ฅผ ํ์ฉํ๋ฉด ์ฝ๋๋ฅผ ๋ ์งง๊ณ ๊ฐ๋จํ๊ฒ ์์ฑํ ์ ์์ต๋๋ค. ์ง์ ๊ฐ์ ธ์์ ์ด๋ค ๋ฌธ์์ด์๋ ์ฌ์ฉํ ์๋ ์์ต๋๋ค. ์ด ๋ฐฉ๋ฒ์ [๋ค์์](../development/scrapling_custom_types.md) ์ค๋ช ํฉ๋๋ค.+### ์ฌ์ฉ๋ฒ {#usage}+์ฌ๋ผ์ด์ฑ, ์ธ๋ฑ์ค ์ ๊ทผ๊ณผ `split`, `replace`, `strip` ๊ฐ์ ๋ฉ์๋๋ ๋ค์ `TextHandler`๋ฅผ ๋ฐํํฉ๋๋ค. ๊ทธ๋์ ์ํ๋ ๋๋ก ์ด์ด์ ์ฌ์ฉํ ์ ์์ต๋๋ค. `TextHandler` ๋์ ์ผ๋ฐ ๋ฌธ์์ด์ ๋ฐํํ๋ ๋ฉ์๋๋ ์์ฑ์ ๋ฐ๊ฒฌํ๋ฉด issue๋ก ์๋ ค์ฃผ์ธ์. ๊ทธ ๋ถ๋ถ๋ ์์ ํ๊ฒ ์ต๋๋ค.++๋จผ์ `re`์ `re_first`๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค. [Selector](#selector), [Selectors](#selectors), [TextHandlers](#texthandlers)์๋ ์๋ ๋ฉ์๋์ด๋ฉฐ ๊ฐ์ ์ธ์๋ฅผ ๋ฐ์ต๋๋ค.++- `re`๋ ์ฒซ ๋ฒ์งธ ์ธ์๋ก ๋ฌธ์์ด์ด๋ ์ปดํ์ผ๋ ์ ๊ท์์ ๋ฐ์ต๋๋ค. ์ผ์นํ๋ ๋ชจ๋ ๋ฌธ์์ด์ ์ฐพ์ [TextHandlers](#texthandlers)๋ก ๋ฐํํฉ๋๋ค. `re_first`๋ ๊ฐ์ ์ธ์๋ฅผ ๋ฐ๊ณ ๋น์ทํ๊ฒ ๋์ํ์ง๋ง, ์ฒซ ๋ฒ์งธ ๊ฒฐ๊ณผ๋ง `TextHandler`๋ก ๋ฐํํฉ๋๋ค.++ ๋ค์๊ณผ ๊ฐ์ ์ถ๊ฐ ์ธ์๋ ์์ต๋๋ค.++ - **replace_entities**: ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. HTML ์ํฐํฐ๋ฅผ ํด๋น ๋ฌธ์๋ก ๋ฐ๊ฟ๋๋ค.+ - **clean_match**: ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค. ์ผ์น ์ฌ๋ถ๋ฅผ ํ์ธํ ๋ ์ฐ์ ๊ณต๋ฐฑ์ ํฌํจํ ๊ณต๋ฐฑ ๋ฌธ์๋ฅผ ๋ฌด์ํฉ๋๋ค.+ - **case_sensitive**: ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ๋๋ฉด ์ ๊ท์์ ์ปดํ์ผํ ๋ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ต๋๋ค.++ ์์ ๋ณธ ์์ ๋๋ค. `re`๋ฅผ ์ฌ์ฉํ์ผ๋ฏ๋ก ๊ฒฐ๊ณผ๋ [TextHandlers](#texthandlers)์ ๋๋ค.+ ```pycon+ >>> page.css('.price::text').re(r'[\d.]+')+ ['10.99', '20.99', '15.99']+ >>> page.css('.product h3::text').re(r'Product (\d+)')+ ['1', '2', '3']+ ```+ ๋ค๋ฅธ ์ธ์๋ฅผ ์ค๋ช ํ๊ธฐ ์ํด ๊ฐ ์์์ ๋ณ๋์ ๋ฌธ์์ด์ ์ฌ์ฉํ๊ฒ ์ต๋๋ค.+ ```python+ >>> from scrapling import TextHandler+ >>> test_string = TextHandler('hi there') # Hence the two spaces+ >>> test_string.re('hi there')+ >>> test_string.re('hi there', clean_match=True) # Using `clean_match` will clean the string before matching the regex+ ['hi there']++ >>> test_string2 = TextHandler('Oh, Hi Mark')+ >>> test_string2.re_first('oh, hi Mark')+ >>> test_string2.re_first('oh, hi Mark', case_sensitive=False) # Hence disabling `case_sensitive`+ 'Oh, Hi Mark'++ # Mixing arguments+ >>> test_string.re('hi there', clean_match=True, case_sensitive=False)+ ['hi there']+ ```+ `TextHandler`๋ฅผ ์ฌ์ฉํ๋ ๋ ๋ค๋ฅธ ์ฅ์ ์ ๋๋ค. `html_content`๋ `TextHandler`๋ฅผ ๋ฐํํ๋ฏ๋ก HTML์ ๋ฐ๋ก ์ ๊ท์์ ์ ์ฉํ ์ ์์ต๋๋ค.+ ```python+ >>> page.html_content.re('div class=".*">(.*)</div')+ ['In stock: 5', 'In stock: 3', 'Out of stock']+ ```++- `.json()`์ ๋ด์ฉ์ ๋น ๋ฅด๊ฒ JSON ๊ฐ์ฒด๋ก ๋ณํํฉ๋๋ค. ๋ณํํ ์ ์์ผ๋ฉด ์ค๋ฅ๋ฅผ ๋ฐ์์ํต๋๋ค.+ ```python+ >>> page.css('#page-data::text').get()+ '\n {\n "lastUpdated": "2024-09-22T10:30:00Z",\n "totalProducts": 3\n }\n '+ >>> page.css('#page-data::text').get().json()+ {'lastUpdated': '2024-09-22T10:30:00Z', 'totalProducts': 3}+ ```+ ์์๋ฅผ ์ ํํ ๋ ํ ์คํธ๋ ์์ฑ๊ฐ ๊ฐ์ ํ ์คํธ ๋ ธ๋๋ฅผ ์ง์ ํ์ง ์์๋ค๋ฉด, ์์์ ํ ์คํธ ๋ด์ฉ์ ์๋์ผ๋ก ์ฌ์ฉํฉ๋๋ค.+ ```python+ >>> page.css('#page-data')[0].json()+ {'lastUpdated': '2024-09-22T10:30:00Z', 'totalProducts': 3}+ ```+ [Selector](#selector)๋ ์ฌ๊ธฐ์ ํ ๊ฐ์ง ๊ธฐ๋ฅ์ ๋ ์ ๊ณตํฉ๋๋ค. ๋ค์ ํ์ด์ง๋ฅผ ์๋ก ๋ค์ด ๋ณด๊ฒ ์ต๋๋ค.+ ```html+ <html>+ <body>+ <div>+ <script id="page-data" type="application/json">+ {+ "lastUpdated": "2024-09-22T10:30:00Z",+ "totalProducts": 3+ }+ </script>+ </div>+ </body>+ </html>+ ```+ [Selector](#selector)์ `get_all_text`๋ ์์ ์ค๋ช ํ๋ฏ `TextHandler`๋ฅผ ๋ฐํํฉ๋๋ค.<br/><br/>+ ๋ค์์ฒ๋ผ ์คํํ๋ฉด,+ ```python+ >>> page.css('div::text').get().json()+ ```+ `div` ํ๊ทธ์ JSON์ผ๋ก ๋ณํํ ์ง์ ์ ์ธ ํ ์คํธ๊ฐ ์์ด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. ์ด ํ๊ทธ์๋ ์ง์ ๋ค์ด ์๋ ํ ์คํธ๊ฐ ์ ํ ์์ต๋๋ค.<br/><br/>+ ์ด๋ `get_all_text`๋ฅผ ์ฌ์ฉํ๋ฉด ๋ฉ๋๋ค.+ ```python+ >>> page.css('div')[0].get_all_text(ignore_tags=[]).json()+ {'lastUpdated': '2024-09-22T10:30:00Z', 'totalProducts': 3}+ ```+ `ignore_tags`์ ๊ธฐ๋ณธ๊ฐ์ด `('script', 'style',)`์ด๋ฏ๋ก ์ฌ๊ธฐ์๋ ๊ฐ์ ๋ฐ๋ก ์ง์ ํ์ต๋๋ค.<br/><br/>+ ๋์ค์ ์ค๋ช ํ Fetcher์์๋ ๊ด๋ จ๋ ๋์์ด ์์ต๋๋ค. ๋ค์๊ณผ ๊ฐ์ JSON ์๋ต์ ๋ฐ์๋ค๊ณ ๊ฐ์ ํด ๋ณด๊ฒ ์ต๋๋ค.+ ```python+ >>> page = Selector("""{"some_key": "some_value"}""")+ ```+ [Selector](#selector)๋ HTML ํ์ด์ง์ ๋ง์ถฐ์ ธ ์์ผ๋ฏ๋ก, ์ด ์๋ต์ ์๋ชป๋ HTML๋ก ๋ณด๊ณ ์์ ํฉ๋๋ค. ๋ฐ๋ผ์ `html_content`๋ฅผ ์ฌ์ฉํ๋ฉด ๋ค์ ๊ฒฐ๊ณผ๊ฐ ๋์ต๋๋ค.+ ```python+ >>> page.html_content+ '<html><body><p>{"some_key": "some_value"}</p></body></html>'+ ```+ ํ์ง๋ง `json` ๋ฉ์๋๋ฅผ ๋ฐ๋ก ํธ์ถํ๋ฉด ์ ์์ ์ผ๋ก ๋์ํฉ๋๋ค.+ ```python+ >>> page.json()+ {'some_key': 'some_value'}+ ```+ `html` ํ๊ทธ์ ์ง์ ์ ์ธ ํ ์คํธ๊ฐ ์๋๋ฐ ์ด๋ป๊ฒ ๊ฐ๋ฅํ ๊ฑธ๊น์?<br/>+ JSON ์๋ต ๊ฐ์ ๊ฒฝ์ฐ๋ฅผ ์ํด [Selector](#selector)๋ ๋ฐ์ ๋ด์ฉ์ ์๋ณธ ์ฌ๋ณธ์ ๋ณด๊ดํฉ๋๋ค. `.json()`์ ๋จผ์ ์๋ณธ์ ํ์ธํ๊ณ JSON์ผ๋ก ๋ณํํฉ๋๋ค. ๊ฐ๋ณ ์์์ฒ๋ผ ์๋ณธ์ด ์์ผ๋ฉด ํ์ฌ ์์์ ํ ์คํธ๋ฅผ ํ์ธํ๊ณ , ํ์ํ๋ฉด `get_all_text`๋ฅผ ์ฌ์ฉํฉ๋๋ค.<br/>++- `.clean()`์ ๊ณต๋ฐฑ ๋ฌธ์์ ์ฐ์ ๊ณต๋ฐฑ์ ์ ๊ฑฐํ๊ณ ์ `TextHandler`๋ฅผ ๋ฐํํฉ๋๋ค.+```python+>>> TextHandler('\n wonderful idea, \reh?').clean()+'wonderful idea, eh?'+```+`remove_entities`๋ฅผ ์ ๋ฌํ๋ฉด `clean`์ด HTML ์ํฐํฐ๋ฅผ ํด๋น ๋ฌธ์๋ก ๋ฐ๊ฟ๋๋ค.++- `.sort()`๋ ๋ฆฌ์คํธ์ฒ๋ผ ๋ฌธ์์ด์ ๋ฌธ์๋ฅผ ์ ๋ ฌํฉ๋๋ค.+```python+>>> TextHandler('acb').sort()+'abc'+```+์ญ์์ผ๋ก ์ ๋ ฌํ ์๋ ์์ต๋๋ค.+```python+>>> TextHandler('acb').sort(reverse=True)+'cba'+```++์์ผ๋ก ๋ ๋ง์ ๋ฉ์๋์ ์์ฑ์ด ์ถ๊ฐ๋ ๊ฒ์ ๋๋ค. ์ด ํด๋์ค๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฑฐ์ ๋ชจ๋ ๊ณณ์์ ์ผ๋ฐ ๋ฌธ์์ด ๋์ ๋ฐํ๋๋ค๋ ์ ์ ๊ธฐ์ตํ์ธ์.++## TextHandlers {#texthandlers}+์ด ํด๋์ค๋ [Selectors](#selectors)์ [Selector](#selector)์ ๊ด๊ณ์ ๋น์ทํฉ๋๋ค. ์ผ๋ฐ ๋ฆฌ์คํธ์ ๋์์ ์์ํ๊ณ `re`, `re_first` ๋ฉ์๋๋ฅผ ์ถ๊ฐํฉ๋๋ค.++์ฌ๊ธฐ์ `re_first`๋ ๊ฐ [TextHandler](#texthandler)์ `re`๋ฅผ ์คํํด ์ฒซ ๋ฒ์งธ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค. ๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด `None`์ ๋ฐํํฉ๋๋ค. ๋๋จธ์ง๋ ์์ ์ค๋ช ๊ณผ ๊ฐ์ผ๋ฉฐ, ์์ผ๋ก ๋ค๋ฅธ ๋ฉ์๋๋ ์ถ๊ฐ๋ ๊ฒ์ ๋๋ค.++## AttributesHandler {#attributeshandler}+Python์ ํ์ค ๋์ ๋๋ฆฌ์ธ `dict`๋ฅผ ์ฝ๊ธฐ ์ ์ฉ์ผ๋ก ๋ง๋ ํํ์ ๋๋ค. ๊ฐ ์์, ์ฆ [Selector](#selector) ๊ฐ์ฒด์ ์์ฑ์ ์ ์ฅํฉ๋๋ค.+```python+>>> print(page.find('script').attrib)+{'id': 'page-data', 'type': 'application/json'}+>>> type(page.find('script').attrib).__name__+'AttributesHandler'+```+์ฝ๊ธฐ ์ ์ฉ์ด๋ฏ๋ก ์ผ๋ฐ ๋์ ๋๋ฆฌ๋ณด๋ค ๋ฆฌ์์ค๋ฅผ ์ ๊ฒ ์ฌ์ฉํฉ๋๋ค. ๋ฐ์ดํฐ๋ฅผ ๋ณ๊ฒฝํ๊ฑฐ๋ ๋ฎ์ด์ฐ๋ ๊ธฐ๋ฅ์ ์ ์ธํ๋ฉด ๋์ ๋๋ฆฌ์ ๊ฐ์ ๋ฉ์๋์ ์์ฑ์ ์ ๊ณตํฉ๋๋ค.++ํ์ฌ ๋ค์ ๋ ๊ฐ์ง ๊ธฐ๋ฅ์ ์ถ๊ฐ๋ก ์ ๊ณตํฉ๋๋ค.++- `search_values` ๋ฉ์๋.++ ์ผ๋ฐ ๋์ ๋๋ฆฌ์์๋ `dict.get("key_name")`์ผ๋ก ํค๋ฅผ ํ์ธํ ์ ์์ง๋ง, ๊ฐ์ผ๋ก ๊ฒ์ํ๋ ค๋ฉด ์ฝ๋๊ฐ ๋ ํ์ํฉ๋๋ค. ์ด ๋ฉ์๋๋ ์์ฑ๊ฐ์ ๊ฒ์ํ๊ณ ์ผ์นํ๋ ํญ๋ชฉ๋ง๋ค ๋์ ๋๋ฆฌ๋ฅผ ๋ฐํํฉ๋๋ค.++ ๊ฐ๋จํ ์์ ๋๋ค.+ ```python+ >>> for i in page.find('script').attrib.search_values('page-data'):+ print(i)+ {'id': 'page-data'}+ ```+ `partial` ์ธ์๋ฅผ ์ฌ์ฉํ๋ฉด ๊ฐ์ ์ผ๋ถ๋ก ๊ฒ์ํ ์๋ ์์ต๋๋ค.+ ```python+ >>> for i in page.find('script').attrib.search_values('page', partial=True):+ print(i)+ {'id': 'page-data'}+ ```+ ์ ์๋ ์ค๋ช ์ ์ํ ๊ฒ์ ๋๋ค. ์ค์ ๋ก๋ `find_all`๊ณผ ํจ๊ป ์ฌ์ฉํด ์์ฑ์ ํน์ ๊ฐ์ด ์๋ ์์๋ฅผ ๋ชจ๋ ์ฐพ์ ์ ์์ต๋๋ค.+ ```python+ >>> page.find_all(lambda element: list(element.attrib.search_values('product')))+ [<data='<article class="product" data-id="1"><h3...' parent='<div class="product-list"> <article clas...'>,+ <data='<article class="product" data-id="2"><h3...' parent='<div class="product-list"> <article clas...'>,+ <data='<article class="product" data-id="3"><h3...' parent='<div class="product-list"> <article clas...'>]+ ```+ ์ด ์์๋ค์ `class` ์์ฑ๊ฐ์ ๋ชจ๋ 'product'์ ๋๋ค.++ `search_values`๋ ์ ๋๋ ์ดํฐ๋ฅผ ๋ฐํํ๋ฏ๋ก ์ฌ๊ธฐ์๋ `list`๋ฅผ ์ฌ์ฉํ์ต๋๋ค. ์ ๋๋ ์ดํฐ ์์ฒด๋ฅผ ์กฐ๊ฑด์ผ๋ก ์ฐ๋ฉด ๋ชจ๋ ์์์์ `True`๊ฐ ๋๊ธฐ ๋๋ฌธ์ ๋๋ค.++- `json_string` ์์ฑ.++ ํ์ฌ ์์ฑ์ JSON ๋ฌธ์์ด๋ก ๋ณํํฉ๋๋ค. JSON์ผ๋ก ๋ณํํ ์ ์์ผ๋ฉด ์ค๋ฅ๋ฅผ ๋ฐ์์ํต๋๋ค.++ ```python+ >>>page.find('script').attrib.json_string+ b'{"id":"page-data","type":"application/json"}'+ ```\ No newline at end of filediff --git a/docs/locales/ko/parsing/selection.md b/docs/locales/ko/parsing/selection.mdnew file mode 100644index 0000000..6a2de79--- /dev/null+++ b/docs/locales/ko/parsing/selection.md@@ -0,0 +1,521 @@+---+title: "CSS, XPath, ํ ์คํธ, ์ ๊ท์์ผ๋ก HTML ๋ฐ์ดํฐ ์ถ์ถํ๊ธฐ"+description: "CSS, XPath, ํ ์คํธ, ์ ๊ท์์ผ๋ก HTML ์์๋ฅผ ์ ํํ์ธ์. Scrapling ์์ ๋ฅผ ํตํด ๋น์ทํ ์์๋ฅผ ์ฐพ๊ณ ํ์ํ ๊ฐ์ ์ถ์ถํฉ๋๋ค."+---++# ์์ ์ฐพ๊ธฐ {#querying-elements}+`Selector`๋ HTML์ ํ์ฑํฉ๋๋ค. ์ ์ํ ๊ธฐ๋ฅ์ด XML์์๋ ์๋ํ์ง ์๊ธฐ ๋๋ฌธ์ ๋๋ค. XML, RSS, Atom ํผ๋๋ XML ํ์๋ฅผ ์ฌ์ฉํด ๊ฐ ํผ๋ ๋ ธ๋๋ฅผ ์ง์ ์ ๋ฌํ๋ [XMLFeedSpider](../spiders/generic-templates.md#xmlfeedspider)๋ฅผ ์ฌ์ฉํ์ธ์.++Scrapling์์ ์์๋ฅผ ์ฐพ๋ ์ฃผ์ ๋ฐฉ๋ฒ์ ๋ค์ฏ ๊ฐ์ง์ ๋๋ค.++1. CSS3 ์ ํ์.+2. XPath ์ ํ์.+3. ํํฐ๋ ์กฐ๊ฑด์ผ๋ก ์ฐพ๊ธฐ.+4. ํน์ ํ ์คํธ๋ฅผ ํฌํจํ๋ ์์ ์ฐพ๊ธฐ.+5. ํน์ ์ ๊ท์๊ณผ ์ผ์นํ๋ ๋ด์ฉ์ ๊ฐ์ง ์์ ์ฐพ๊ธฐ.++๊ฐ์ ์ ์ผ๋ก ์์๋ฅผ ์ฐพ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ๋ ์์ง๋ง, ์ฌ๊ธฐ์๋ ์ฃผ์ ๋ฐฉ๋ฒ์ ์์ธํ ๋ค๋ฃน๋๋ค. ์ด๋ฏธ ์ฐพ์ ์์์ ๋น์ทํ ์์๋ฅผ ์ฐพ๋ ๊ธฐ๋ฅ๋ ์ค๋ช ํฉ๋๋ค. [ํด๋น ์น์ ์ผ๋ก ๋ฐ๋ก ์ด๋](#finding-similar-elements)ํ ์๋ ์์ต๋๋ค.++์น ์คํฌ๋ํ์ด ์ฒ์์ด๊ณ ์ ํ์๋ฅผ ์์ฑํ ๊ฒฝํ์ด ์ ๋ค๋ฉด, [์ฌ๊ธฐ์](#filters-based-searching) `find`/`find_all` ๋ฉ์๋๋ถํฐ ๋ฐฐ์ฐ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.++## CSS/XPath ์ ํ์ {#cssxpath-selectors}++### CSS ์ ํ์๋? {#what-are-css-selectors}+[CSS](https://en.wikipedia.org/wiki/CSS)๋ HTML ๋ฌธ์์ ์คํ์ผ์ ์ ์ฉํ๋ ์ธ์ด์ ๋๋ค. ์ ํ์๋ ์คํ์ผ์ ์ ์ฉํ HTML ์์๋ฅผ ์ง์ ํฉ๋๋ค.++Scrapling์ [W3C ๋ช ์ธ](http://www.w3.org/TR/2011/REC-css3-selectors-20110929/)์ ๋ฐ๋ฅธ CSS3 ์ ํ์๋ฅผ ์ง์ํฉ๋๋ค. CSS ์ง์์๋ `cssselect`๋ฅผ ์ฌ์ฉํ๋ฏ๋ก, [์ง์ํ๋ ์ ํ์](https://cssselect.readthedocs.io/en/latest/#supported-selectors)์ ์์ฌ ํจ์ ๋ฐ ์์ฌ ์์๋ ํด๋น ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.++Scrapling์ ๋ค์๊ณผ ๊ฐ์ ๋นํ์ค ์์ฌ ์์๋ ์ง์ํฉ๋๋ค.++* ํ ์คํธ ๋ ธ๋๋ ``::text``๋ก ์ ํํฉ๋๋ค.+* ์์ฑ๊ฐ์ ``::attr(name)``์ผ๋ก ์ ํํฉ๋๋ค. name์ ๊ฐ์ ๊ฐ์ ธ์ฌ ์์ฑ์ ์ด๋ฆ์ ๋๋ค.++Scrapy๋ Parsel์ ์ฌ์ฉํด ๋ดค๋ค๋ฉด ์ต์ํ ๋ฐฉ์์ ๋๋ค. ๋ง์ ์ฌ์ฉ์๊ฐ ์ด๋ฏธ ์ต์ํ ๋ฐฉ์์ ๊ตณ์ด ๋ฐ๊ฟ ํ์๋ ์์ผ๋๊น์ :)++CSS๋ก ์์๋ฅผ ์ ํํ๋ ค๋ฉด `css` ๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ฒฐ๊ณผ๋ `Selectors`์ ๋๋ค. `[0]`์ผ๋ก ์ฒซ ๋ฒ์งธ ์์๋ฅผ ๊ฐ์ ธ์ค๊ฑฐ๋, `.get()` / `.getall()`๋ก ํ ์คํธ๋ ์์ฑ ์ ํ ๊ฒฐ๊ณผ์ ๊ฐ์ ์ถ์ถํ ์ ์์ต๋๋ค.++### XPath ์ ํ์๋? {#what-are-xpath-selectors}+[XPath](https://en.wikipedia.org/wiki/XPath)๋ XML ๋ฌธ์์ ๋ ธ๋๋ฅผ ์ ํํ๋ ์ธ์ด์ด๋ฉฐ HTML์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด [์์ฝํ](https://devhints.io/xpath)๋ [XPath](https://en.wikipedia.org/wiki/XPath)๋ฅผ ๋ฐฐ์ฐ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. Scrapling์ [lxml](https://lxml.de/)์ ํตํด XPath ์ ํ์๋ฅผ ์ ๊ณตํฉ๋๋ค.++CSS์ ๋ง์ฐฌ๊ฐ์ง๋ก Scrapy๋ Parsel๊ณผ ๊ฐ์ ๋ฐฉ์์ ๋๋ค. ๋ค๋ง Scrapling์ XPath ํ์ฅ ํจ์ `has-class`๋ฅผ ์ ๊ณตํ์ง ์์ต๋๋ค. ๋์ ๋ฐํ๋ ์์์์ ๊ฐ์ ๋ชฉ์ ์ผ๋ก `has_class` ๋ฉ์๋๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.++XPath๋ก ์์๋ฅผ ์ ํํ๋ ค๋ฉด `xpath`๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋์ ๋ฐฉ์์ ์์ CSS ๋ฉ์๋์ ๊ฐ์ต๋๋ค.++> `css`์ `xpath`์๋ ์ ์ํ ๊ธฐ๋ฅ์ ์ํ ์ถ๊ฐ ์ธ์๋ ์์ต๋๋ค. ์ ์ํ ๊ธฐ๋ฅ์ ๋ณ๋ ํ์ด์ง์์ ์์ธํ ์ค๋ช ํ๋ฏ๋ก ์ฌ๊ธฐ์๋ ๋ค๋ฃจ์ง ์์ต๋๋ค.++### ์ ํ์ ์์ {#selectors-examples}+CSS์ XPath๋ก ๊ฐ์ ์์ ์ ํ๋ ์๋ฅผ ๋ณด๊ฒ ์ต๋๋ค.++ํด๋์ค๊ฐ `product`์ธ ๋ชจ๋ ์์๋ฅผ ์ ํํฉ๋๋ค.+```python+products = page.css('.product')+products = page.xpath('//*[@class="product"]')+```+!!! info "์ฐธ๊ณ "++ ์์์ ๋ค๋ฅธ ํด๋์ค๋ ์์ผ๋ฉด ์ด XPath ์๋ ์ ํํ์ง ์์ต๋๋ค. **ํด๋์ค๋ก ์ ํํ ๋๋ CSS๋ฅผ ์ฌ์ฉํ๋ ํธ์ด ์ข์ต๋๋ค.**++ํด๋์ค๊ฐ `product`์ธ ์ฒซ ๋ฒ์งธ ์์๋ฅผ ์ ํํฉ๋๋ค.+```python+product = page.css('.product')[0]+product = page.xpath('//*[@class="product"]')[0]+```+ํ๊ทธ๊ฐ `h1`์ธ ์ฒซ ๋ฒ์งธ ์์์ ํ ์คํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+title = page.css('h1::text').get()+title = page.xpath('//h1//text()').get()+```+๋ค์ ์ฝ๋์ ๊ฐ์ต๋๋ค.+```python+title = page.css('h1')[0].text+title = page.xpath('//h1')[0].text+```+ํ๊ทธ๊ฐ `a`์ธ ์ฒซ ๋ฒ์งธ ์์์ `href` ์์ฑ์ ๊ฐ์ ธ์ต๋๋ค.+```python+link = page.css('a::attr(href)').get()+link = page.xpath('//a/@href').get()+```+ํด๋์ค๊ฐ `product`์ธ ์์ ์๋์์ `Phone`์ ํฌํจํ๋ ์ฒซ ๋ฒ์งธ `h1` ์์์ ํ ์คํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+title = page.css('.product h1:contains("Phone")::text').get()+title = page.xpath('//*[@class="product"]//h1[contains(text(),"Phone")]/text()').get()+```+๊ฒฐ๊ณผ๊ฐ ์๋ ํ ์ ํ์๋ฅผ ์ค์ฒฉํ๊ฑฐ๋ ์ด์ด์ ์ฌ์ฉํ ์ ์์ต๋๋ค.+```python+page.css('.product')[0].css('h1:contains("Phone")::text').get()+page.xpath('//*[@class="product"]')[0].xpath('.//h1[contains(text(),"Phone")]/text()').get()+page.xpath('//*[@class="product"]')[0].css('h1:contains("Phone")::text').get()+```+ํ์ฌ ์์๋ฅผ ๊ธฐ์ค์ผ๋ก XPath๋ฅผ ์คํํ๋ ค๋ฉด `.//`๋ฅผ ์ฌ์ฉํ์ธ์. `//`๋ก ์์ํ๋ฉด ์ํ ์์๋ฅผ ์ ํํ ๋ค์๋ ๋ฌธ์ ์ ์ฒด์์ ๊ฒ์ํฉ๋๋ค.++๋ค๋ฅธ ์๋ ๋ณด๊ฒ ์ต๋๋ค.++'href' ์์ฑ์ 'image'๊ฐ ๋ค์ด ์๋ ๋ชจ๋ ๋งํฌ๋ฅผ ์ฐพ์ต๋๋ค.+```python+links = page.css('a[href*="image"]')+links = page.xpath('//a[contains(@href, "image")]')+for index, link in enumerate(links):+ link_value = link.attrib['href'] # Cleaner than link.css('::attr(href)').get()+ link_text = link.text+ print(f'Link number {index} points to this url {link_value} with text content as "{link_text}"')+```++## ํ ์คํธ ๋ด์ฉ์ผ๋ก ์ ํํ๊ธฐ {#text-content-selection}+Scrapling์ ์์์ ์ง์ ๋ค์ด ์๋ ํ ์คํธ๋ก ์์๋ฅผ ์ ํํ ์ ์์ต๋๋ค. ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ด ์์ต๋๋ค.++1. `find_by_text`๋ ์ง์ ํ ํ ์คํธ๋ฅผ ํฌํจํ๋ ์์๋ฅผ ์ฐพ์ผ๋ฉฐ ์ฌ๋ฌ ์ต์ ์ ์ ๊ณตํฉ๋๋ค.+2. `find_by_regex`๋ ์ง์ ํ ์ ๊ท์๊ณผ ํ ์คํธ๊ฐ ์ผ์นํ๋ ์์๋ฅผ ์ฐพ์ผ๋ฉฐ ์ฌ๋ฌ ์ต์ ์ ์ ๊ณตํฉ๋๋ค.++์ ๊ท์์ ์ต์ํ๋ค๋ฉด `find_by_text`์ ์์ ์ `find_by_regex`๋ก๋ ํ ์ ์์ต๋๋ค. ํ์ง๋ง ๋ชจ๋ ์ฌ์ฉ์๊ฐ ์ฝ๊ฒ ์ฌ์ฉํ ์ ์๋๋ก ๋ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค.++`find_by_text`์๋ ์ฒซ ๋ฒ์งธ ์ธ์๋ก ํ ์คํธ๋ฅผ, `find_by_regex`์๋ ์ ๊ท์์ ์ ๋ฌํฉ๋๋ค. ๋ ๋ฉ์๋๋ ๋ค์ ์ธ์๋ฅผ ํจ๊ป ์ง์ํฉ๋๋ค.++* **first_match**: `True`์ด๋ฉด ์ฒซ ๋ฒ์งธ ๊ฒฐ๊ณผ๋ง ๋ฐํํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ๋ ๊ฐ์ต๋๋ค.+* **case_sensitive**: `True`์ด๋ฉด ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํฉ๋๋ค.+* **clean_match**: `True`์ด๋ฉด ๋น๊ต ์ ์ ๊ณต๋ฐฑ ๋ฌธ์์ ์ฐ์ ๊ณต๋ฐฑ์ ํ๋์ ๊ณต๋ฐฑ์ผ๋ก ๋ฐ๊ฟ๋๋ค.++`find_by_text`๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ ํํ ์ผ์นํ๋ ํ ์คํธ๋ฅผ ์ฐพ์ต๋๋ค. ์์์ ์ ์ฒด ํ ์คํธ๊ฐ ์ ๋ ฅํ ํ ์คํธ์ ๊ฐ์์ผ ํฉ๋๋ค. ์ด๋ฅผ ๋ฐ๊พธ๋ ์ถ๊ฐ ์ธ์๊ฐ ์์ต๋๋ค.++* **partial**: ์ผ๋ฉด `find_by_text`๊ฐ ์ ๋ ฅํ ํ ์คํธ๋ฅผ ํฌํจํ๋ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ์ ์ฒด๊ฐ ์ผ์นํ ํ์๋ ์์ต๋๋ค.++!!! abstract "์ฐธ๊ณ "++ `find_by_regex`์ ์ฒซ ๋ฒ์งธ ์ธ์๋ ์ผ๋ฐ ๋ฌธ์์ด์ด๋ ์ปดํ์ผ๋ ์ ๊ท์ ๋ชจ๋ ๊ฐ๋ฅํฉ๋๋ค. ์๋ ์์์ ํ์ธํ ์ ์์ต๋๋ค.++### ๋น์ทํ ์์ ์ฐพ๊ธฐ {#finding-similar-elements}+Scrapling์ ์ด๋ฏธ ์ฐพ์ ์์์ ๋น์ทํ ์์๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. AutoScraper์์ ์์ด๋์ด๋ฅผ ์ป์์ง๋ง, Scrapling์์๋ ์ด๋ค ๋ฐฉ๋ฒ์ผ๋ก ์ฐพ์ ์์์๋ ์ ์ฉํ ์ ์์ต๋๋ค. ํ ์คํธ๋ก ์์๋ฅผ ์ฐพ์ ๋ค ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง์ผ๋ฏ๋ก ์ฌ๊ธฐ์ ์ค๋ช ํ๊ฒ ์ต๋๋ค.++์ด๋ป๊ฒ ์๋ํ ๊น์?++์ํ ์ด๋ฆ์ผ๋ก ์์๋ฅผ ์ฐพ์ ๋ค, ๊ฐ์ ํ๋ ์ปจํ ์ด๋ ์์ ๋ค๋ฅธ ์ํ๋ ์ถ์ถํ๊ณ ์ถ๋ค๊ณ ๊ฐ์ ํด ๋ณด๊ฒ ์ต๋๋ค. ์ฐพ์ ์์์์ `.find_similar()`๋ฅผ ํธ์ถํ๋ฉด Scrapling์ด ๋ค์ ์์ ์ ํฉ๋๋ค.++1. DOM ํธ๋ฆฌ์์ ๊ฐ์ ๊น์ด์ ์๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+2. ํ๊ทธ ์ด๋ฆ, ๋ถ๋ชจ์ ํ๊ทธ ์ด๋ฆ, ์กฐ๋ถ๋ชจ์ ํ๊ทธ ์ด๋ฆ์ด ๊ฐ์ง ์์ ์์๋ฅผ ์ ์ธํฉ๋๋ค.+3. ์ด ๋จ๊ณ์์๋ ์ํ๋ ์์์ผ ๊ฐ๋ฅ์ฑ์ด ์ฝ 99%์ ๋๋ค. ๋ง์ง๋ง์ผ๋ก ์์ฑ์ ์ ์ฌ๋๋ฅผ ๋น๊ตํด ์๋ ์์์ ์ถฉ๋ถํ ๋น์ทํ์ง ์์ ์์๋ฅผ ์ ์ธํฉ๋๋ค. ์ด๋ ์ฌ์ฉํ ๋น์จ์ ์ค์ ํ ์ ์์ง๋ง, ๊ธฐ๋ณธ ์ค์ ์ผ๋ก ์ํ๋ ์์๋ฅผ ์ฐพ์ง ๋ชปํ ๋๋ง ๋ฐ๊พธ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.++์ค๋ช ์ด ๊ธธ์์ง๋ง ๋์ ์๋ฆฌ๋ฅผ ์๋ ค๋๋ฆฌ๊ณ ์ถ์์ต๋๋ค. ๋ค์ ์น์ ์์ ์๋ฅผ ๋ณด๊ธฐ ์ ์ ๋ฉ์๋์ ์ธ์๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++* **similarity_threshold**: 3๋จ๊ณ์์ ์์ฑ์ ๋น๊ตํ๋ ์ ์ฌ๋ ๊ธฐ์ค์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 0.2๋ก, ๋ ์์์ ์์ฑ์ด ์ ์ด๋ 20% ๋น์ทํด์ผ ํ๋ค๋ ๋ป์ ๋๋ค. 0์ผ๋ก ์ค์ ํ๋ฉด ์ด ๊ฒ์ฌ๋ฅผ ๋ ์ ์์ง๋ง, ๋จผ์ ๋ค๋ฅธ ์ธ์๋ ์ฝ์ด๋ณด์ธ์.+* **ignore_attributes**: ๋ง์ง๋ง ๋น๊ต์์ ๋ฌด์ํ ์์ฑ ์ด๋ฆ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `('href', 'src',)`์ ๋๋ค. URL์ ์์๋ง๋ค ํฌ๊ฒ ๋ฌ๋ผ์ง ์ ์์ด ๋น๊ต ๊ธฐ์ค์ผ๋ก ์ ํฉํ์ง ์๊ธฐ ๋๋ฌธ์ ๋๋ค.+* **match_text**: `True`์ด๋ฉด 3๋จ๊ณ์์ ์์์ ํ ์คํธ๋ ๋น๊ตํฉ๋๋ค. ์ผ๋ฐ์ ์ธ ๊ฒฝ์ฐ์๋ ๊ถ์ฅํ์ง ์์ง๋ง ์์ ์ ๋ฐ๋ผ ์ ์ฉํ ์ ์์ต๋๋ค.++์ด์ ์์ ๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค.++### ์์ {#examples}+์ผ๋ฐ ํ ์คํธ์ ์ ๊ท์์ผ๋ก ์์๋ฅผ ์ฐพ๋ ์์ ๋๋ค.++์ฌ๊ธฐ์๋ `Fetcher` ํด๋์ค๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์์ธํ ์ค๋ช ์ ๋ค์์ ๋ค๋ฃน๋๋ค.+```python+from scrapling.fetchers import Fetcher+page = Fetcher.get('https://books.toscrape.com/index.html')+```+ํ ์คํธ๊ฐ ์ง์ ํ ๋ฌธ์์ด๊ณผ ์์ ํ ๊ฐ์ ์ฒซ ๋ฒ์งธ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_by_text('Tipping the Velvet')+<data='<a href="catalogue/tipping-the-velvet_99...' parent='<h3><a href="catalogue/tipping-the-velve...'>+```+`page.urljoin`์ ์ฌ์ฉํด ์๋ ๊ฒฝ๋ก์ธ `href`๋ฅผ ์ ์ฒด URL๋ก ๋ฐ๊ฟ๋๋ค.+```python+>>> page.find_by_text('Tipping the Velvet').attrib['href']+'catalogue/tipping-the-velvet_999/index.html'+>>> page.urljoin(page.find_by_text('Tipping the Velvet').attrib['href'])+'https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html'+```+์ผ์นํ๋ ์์๊ฐ ์ฌ๋ฌ ๊ฐ๋ผ๋ฉด ๋ชจ๋ ๊ฐ์ ธ์ต๋๋ค. ๊ฒฐ๊ณผ๊ฐ ๋ฆฌ์คํธ๋ผ๋ ์ ์ ์ฃผ๋ชฉํ์ธ์.+```python+>>> page.find_by_text('Tipping the Velvet', first_match=False)+[<data='<a href="catalogue/tipping-the-velvet_99...' parent='<h3><a href="catalogue/tipping-the-velve...'>]+```+๋ถ๋ถ ์ผ์น๋ฅผ ์ฌ์ฉํด `the`๋ฅผ ํฌํจํ๋ ๋ชจ๋ ์์๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> results = page.find_by_text('the', partial=True, first_match=False)+>>> [i.text for i in results]+['A Light in the ...',+ 'Tipping the Velvet',+ 'The Requiem Red',+ 'The Dirty Little Secrets ...',+ 'The Coming Woman: A ...',+ 'The Boys in the ...',+ 'The Black Maria',+ 'Mesaerion: The Best Science ...',+ "It's Only the Himalayas"]+```+๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ผ๋ฏ๋ก ๊ฒฐ๊ณผ์๋ ์๋ฌธ์ `the`๋ฟ ์๋๋ผ `The`๋ ์์ต๋๋ค. `the`๋ง ํฌํจํ๋ ์์๋ก ์ ํํด ๋ณด๊ฒ ์ต๋๋ค.+```python+>>> results = page.find_by_text('the', partial=True, first_match=False, case_sensitive=True)+>>> [i.text for i in results]+['A Light in the ...',+ 'Tipping the Velvet',+ 'The Boys in the ...',+ "It's Only the Himalayas"]+```+๊ฐ๊ฒฉ์ ์ฐพ๋ ์ ๊ท์๊ณผ ํ ์คํธ๊ฐ ์ผ์นํ๋ ์ฒซ ๋ฒ์งธ ์์๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> page.find_by_regex(r'ยฃ[\d\.]+')+<data='<p class="price_color">ยฃ51.77</p>' parent='<div class="product_price"> <p class="pr...'>+>>> page.find_by_regex(r'ยฃ[\d\.]+').text+'ยฃ51.77'+```+์ปดํ์ผ๋ ์ ๊ท์์ ์ ๋ฌํด๋ ๊ฐ์ต๋๋ค. Scrapling์ด ์ ๋ ฅ ํ์ ์ ์์์ ์ฒ๋ฆฌํฉ๋๋ค.+```python+>>> import re+>>> regex = re.compile(r'ยฃ[\d\.]+')+>>> page.find_by_regex(regex)+<data='<p class="price_color">ยฃ51.77</p>' parent='<div class="product_price"> <p class="pr...'>+>>> page.find_by_regex(regex).text+'ยฃ51.77'+```+์ ๊ท์๊ณผ ์ผ์นํ๋ ๋ชจ๋ ์์๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> page.find_by_regex(r'ยฃ[\d\.]+', first_match=False)+[<data='<p class="price_color">ยฃ51.77</p>' parent='<div class="product_price"> <p class="pr...'>,+ <data='<p class="price_color">ยฃ53.74</p>' parent='<div class="product_price"> <p class="pr...'>,+ <data='<p class="price_color">ยฃ50.10</p>' parent='<div class="product_price"> <p class="pr...'>,+ <data='<p class="price_color">ยฃ47.82</p>' parent='<div class="product_price"> <p class="pr...'>,+ ...]+```+์ด๋ฐ ์์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.++ํ์ฌ ์์์ ์์น ๋ฐ ์์ฑ์ด ๋น์ทํ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค. ์ฌ๊ธฐ์๋ 'title' ์์ฑ์ ๋น๊ต์์ ์ ์ธํฉ๋๋ค.+```python+>>> element = page.find_by_text('Tipping the Velvet')+>>> element.find_similar(ignore_attributes=['title'])+[<data='<a href="catalogue/a-light-in-the-attic_...' parent='<h3><a href="catalogue/a-light-in-the-at...'>,+ <data='<a href="catalogue/soumission_998/index....' parent='<h3><a href="catalogue/soumission_998/in...'>,+ <data='<a href="catalogue/sharp-objects_997/ind...' parent='<h3><a href="catalogue/sharp-objects_997...'>,+...]+```+์์๊ฐ 20๊ฐ๊ฐ ์๋๋ผ 19๊ฐ์ธ ์ด์ ๋ ํ์ฌ ์์ ์์ฒด๋ ๊ฒฐ๊ณผ์ ํฌํจ๋์ง ์๊ธฐ ๋๋ฌธ์ ๋๋ค.+```python+>>> len(element.find_similar(ignore_attributes=['title']))+19+```+๋น์ทํ ๋ชจ๋ ์์์ `href` ์์ฑ์ ๊ฐ์ ธ์ต๋๋ค.+```python+>>> [+ element.attrib['href']+ for element in element.find_similar(ignore_attributes=['title'])+]+['catalogue/a-light-in-the-attic_1000/index.html',+ 'catalogue/soumission_998/index.html',+ 'catalogue/sharp-objects_997/index.html',+ ...]+```+์กฐ๊ธ ๋ ๋ณต์กํ ์๋ก, ์ฐพ์ ์์๋ฅผ ์์์ ์ผ๋ก ์ผ์ ๋ชจ๋ ์ฑ ์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ ๋ณด๊ฒ ์ต๋๋ค.+```python+>>> first_product = element.parent.parent+>>> for product in [first_product, *first_product.find_similar()]:+ print({+ "name": product.css('h3 a::text').get(),+ "price": product.css('.price_color')[0].re_first(r'[\d\.]+'),+ "stock": product.css('.availability::text').getall()[-1].clean()+ })+{'name': 'Tipping the Velvet', 'price': '53.74', 'stock': 'In stock'}+{'name': 'A Light in the ...', 'price': '51.77', 'stock': 'In stock'}+{'name': 'Soumission', 'price': '50.10', 'stock': 'In stock'}+{'name': 'Sharp Objects', 'price': '47.82', 'stock': 'In stock'}+...+```+### ๊ณ ๊ธ ์์ {#advanced-examples}+`find_similar`๋ฅผ ์ฌ์ฉํ๋ ๋ ๋ณต์กํ๊ณ ์ค์ฉ์ ์ธ ์์ ๋๋ค.++์ผํ๋ชฐ ์ํ ์ถ์ถ:+```python+def extract_product_grid(page):+ # Find the first product card+ first_product = page.find_by_text('Add to Cart').find_ancestor(+ lambda e: e.has_class('product-card')+ )++ # Find similar product cards+ products = [first_product, *first_product.find_similar()]++ return [+ {+ 'name': p.css('h3::text').get(),+ 'price': p.css('.price::text').re_first(r'\d+\.\d{2}'),+ 'stock': 'In stock' in p.get_all_text(),+ 'rating': p.css('.rating')[0].attrib.get('data-rating')+ }+ for p in products+ ]+```+ํ์ ํ ์ถ์ถ:+```python+def extract_table_data(page):+ # Find the first data row+ first_row = page.css('table tbody tr')[0]++ # Find similar rows+ rows = [first_row, *first_row.find_similar()]++ return [+ {+ 'column1': row.css('td:nth-child(1)::text').get(),+ 'column2': row.css('td:nth-child(2)::text').get(),+ 'column3': row.css('td:nth-child(3)::text').get()+ }+ for row in rows+ ]+```+ํผ ํ๋ ์ถ์ถ:+```python+def extract_form_fields(page):+ # Find first form field container+ first_field = page.css('input')[0].find_ancestor(+ lambda e: e.has_class('form-field')+ )++ # Find similar field containers+ fields = [first_field, *first_field.find_similar()]++ return [+ {+ 'label': f.css('label::text').get(),+ 'type': f.css('input')[0].attrib.get('type'),+ 'required': 'required' in f.css('input')[0].attrib+ }+ for f in fields+ ]+```+์ฌ์ดํธ์ ๋ฆฌ๋ทฐ ์ถ์ถ:+```python+def extract_reviews(page):+ # Find first review+ first_review = page.find_by_text('Great product!')+ review_container = first_review.find_ancestor(+ lambda e: e.has_class('review')+ )++ # Find similar reviews+ all_reviews = [review_container, *review_container.find_similar()]++ return [+ {+ 'text': r.css('.review-text::text').get(),+ 'rating': r.attrib.get('data-rating'),+ 'author': r.css('.reviewer::text').get()+ }+ for r in all_reviews+ ]+```+## ํํฐ๋ก ์ฐพ๊ธฐ {#filters-based-searching}+์ด ๋ฐฉ๋ฒ์ ๊ธฐ๋ฅ์ด ๋ค์ํ๋ฉด์๋ ์ ํ์๋ฅผ ์์ฑํ๋ ๊ฒ๋ณด๋ค ๋ฐฐ์ฐ๊ธฐ ์ฌ์, ์คํฌ๋ํ์ ์ฒ์ ์์ํ ๋ ํนํ ์ ์ฉํฉ๋๋ค.++BeautifulSoup์ `find_all`์์ ์์ด๋์ด๋ฅผ ์ป์ `find_all`๊ณผ `find`๋ ์ฌ๋ฌ ํํฐ๋ฅผ ๋ฐ๊ณ , ๋ชจ๋ ์กฐ๊ฑด์ ๋ง๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.++์ธ์๋ ๋ค์๊ณผ ๊ฐ์ด ํด์ํฉ๋๋ค.++* ๋ฌธ์์ด์ ํ๊ทธ ์ด๋ฆ์ผ๋ก ๋ด ๋๋ค.+* List/Tuple/Set ๊ฐ์ ๋ฐ๋ณต ๊ฐ๋ฅํ ๊ฐ์ฒด๋ ํ๊ทธ ์ด๋ฆ์ ๋ชจ์์ผ๋ก ๋ด ๋๋ค.+* ๋์ ๋๋ฆฌ๋ HTML ์์์ ์์ฑ ์ด๋ฆ๊ณผ ๊ฐ์ ๋ํ๋ ๋๋ค.+* ์ ๊ท์์ `find_by_regex`์ฒ๋ผ ์์์ ๋ด์ฉ์ผ๋ก ํํฐ๋งํฉ๋๋ค.+* ํจ์๋ ์์๋ฅผ ํํฐ๋งํ๋ ์กฐ๊ฑด์ผ๋ก ์ฌ์ฉํฉ๋๋ค.+* ํค์๋ ์ธ์๋ HTML ์์ฑ ์ด๋ฆ๊ณผ ๊ฐ์ผ๋ก ๋ด ๋๋ค.++์ ๋ฌํ ์ธ์๋ฅผ ๋ชจ์ ํํฐ๋ฅผ ์ฐจ๋ก๋ก ์ ์ฉํฉ๋๋ค. ๊ฐ ํํฐ์ ๊ฒฐ๊ณผ๊ฐ ๋ค์ ํํฐ๋ก ์ ๋ฌ๋ฉ๋๋ค.++ํ์ฌ ํ์ด์ง๋ ์์ ์์์ ๋ค์ ์์๋ก ํํฐ๋งํฉ๋๋ค.++1. ์ ๋ฌํ ํ๊ทธ ์ด๋ฆ์ ๋ง๋ ์์๋ฅผ ๋ชจ์๋๋ค.+2. ์ ๋ฌํ ๋ชจ๋ ์์ฑ๊ณผ ์ผ์นํ๋ ์์๋ฅผ ๋ชจ์๋๋ค. ์ ๋จ๊ณ๊ฐ ์์๋ค๋ฉด ๊ทธ ๊ฒฐ๊ณผ๋ง ํํฐ๋งํฉ๋๋ค.+3. ์ ๋ฌํ ๋ชจ๋ ์ ๊ท์๊ณผ ์ผ์นํ๋ ์์๋ฅผ ๋ชจ์๋๋ค. ์ ๋จ๊ณ๊ฐ ์์๋ค๋ฉด ๊ทธ ๊ฒฐ๊ณผ๋ง ํํฐ๋งํฉ๋๋ค.+4. ์ ๋ฌํ ๋ชจ๋ ํจ์์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ์์๋ฅผ ๋ชจ์๋๋ค. ์ ๋จ๊ณ๊ฐ ์์๋ค๋ฉด ๊ทธ ๊ฒฐ๊ณผ๋ง ํํฐ๋งํฉ๋๋ค.++!!! note "์ฐธ๊ณ "++ 1. ์ ์์์์ ์ฒ์์ผ๋ก ์ฃผ์ด์ง ํํฐ๋ถํฐ ์์ํฉ๋๋ค. ํ๊ทธ ์ด๋ฆ ์์ด ์์ฑ๋ง ์ ๋ฌํ๋ค๋ฉด 2๋จ๊ณ๋ถํฐ ์์ํฉ๋๋ค.+ 2. ์ธ์๋ฅผ ์ ๋ฌํ ์์๋ ์ํฅ์ ์ฃผ์ง ์์ต๋๋ค. ์์์ ์ค๋ช ํ ์์๋ง ์ฌ์ฉํฉ๋๋ค.++์์ ๋ฅผ ๋ณด๋ฉด ๋ ์ฝ๊ฒ ์ดํดํ ์ ์์ต๋๋ค :)++### ์์ {#examples_1}+```python+from scrapling.fetchers import Fetcher+page = Fetcher.get('https://quotes.toscrape.com/')+```+ํ๊ทธ๊ฐ `div`์ธ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all('div')+[<data='<div class="container"> <div class="row...' parent='<body> <div class="container"> <div clas...'>,+ <data='<div class="row header-box"> <div class=...' parent='<div class="container"> <div class="row...'>,+...]+```+ํด๋์ค๊ฐ `quote`์ธ ๋ชจ๋ div ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all('div', class_='quote')+[<data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+ <data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+...]+```+์์ ๊ฐ์ ์์ ์ ๋๋ค.+```python+>>> page.find_all('div', {'class': 'quote'})+[<data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+ <data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+...]+```+ํด๋์ค๊ฐ `quote`์ธ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all({'class': 'quote'})+[<data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+ <data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+...]+```+ํด๋์ค๊ฐ `quote`์ธ div ์ค, ๋ด์ฉ์ 'world'๊ฐ ์๋ `.text` ์์๋ฅผ ํฌํจํ๋ ๊ฒ์ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all('div', {'class': 'quote'}, lambda e: "world" in e.css('.text::text').get())+[<data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>]+```+์์์ด ์๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all(lambda element: len(element.children) > 0)+[<data='<html lang="en"><head><meta charset="UTF...'>,+ <data='<head><meta charset="UTF-8"><title>Quote...' parent='<html lang="en"><head><meta charset="UTF...'>,+ <data='<body> <div class="container"> <div clas...' parent='<html lang="en"><head><meta charset="UTF...'>,+...]+```+๋ด์ฉ์ 'world'๊ฐ ์๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all(lambda element: "world" in element.text)+[<data='<span class="text" itemprop="text">โThe...' parent='<div class="quote" itemscope itemtype="h...'>,+ <data='<a class="tag" href="/tag/world/page/1/"...' parent='<div class="tags"> Tags: <meta class="ke...'>]+```+์ง์ ํ ์ ๊ท์๊ณผ ์ผ์นํ๋ ๋ชจ๋ span ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all('span', re.compile(r'world'))+[<data='<span class="text" itemprop="text">โThe...' parent='<div class="quote" itemscope itemtype="h...'>]+```+ํด๋์ค๊ฐ 'quote'์ธ div์ span์ ์ฐพ์ต๋๋ค. ํด๋น span์ด ์์ผ๋ฏ๋ก div๋ง ๋ฐํ๋ฉ๋๋ค.+```python+>>> page.find_all(['div', 'span'], {'class': 'quote'})+[<data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+ <data='<div class="quote" itemscope itemtype="h...' parent='<div class="col-md-8"> <div class="quote...'>,+...]+```+์ฌ๋ฌ ์กฐ๊ฑด์ ์์ด ์ฌ์ฉํ ์๋ ์์ต๋๋ค.+```python+>>> page.find_all({'itemtype':"http://schema.org/CreativeWork"}, 'div').css('.author::text').getall()+['Albert Einstein',+ 'J.K. Rowling',+...]+```+์ถ๊ฐ ํ: `href` ์์ฑ๊ฐ์ด 'Einstein'์ผ๋ก ๋๋๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all({'href$': 'Einstein'})+[<data='<a href="/author/Albert-Einstein">(about...' parent='<span>by <small class="author" itemprop=...'>,+ <data='<a href="/author/Albert-Einstein">(about...' parent='<span>by <small class="author" itemprop=...'>,+ <data='<a href="/author/Albert-Einstein">(about...' parent='<span>by <small class="author" itemprop=...'>]+```+๋ ๋ค๋ฅธ ํ: `href` ์์ฑ๊ฐ์ '/author/'๊ฐ ํฌํจ๋ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.+```python+>>> page.find_all({'href*': '/author/'})+[<data='<a href="/author/Albert-Einstein">(about...' parent='<span>by <small class="author" itemprop=...'>,+ <data='<a href="/author/J-K-Rowling">(about)</a...' parent='<span>by <small class="author" itemprop=...'>,+ <data='<a href="/author/Albert-Einstein">(about...' parent='<span>by <small class="author" itemprop=...'>,+...]+```+์ด๋ฐ ์์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.++## ์ ํ์ ์์ฑํ๊ธฐ {#generating-selectors}+์ด๋ค ๋ฐฉ๋ฒ์ผ๋ก ์ฐพ์ ์์๋ CSS/XPath ์ ํ์๋ฅผ ์์ฑํ ์ ์์ต๋๋ค. ์์ฑํ ์ ํ์๋ ์ด๊ณณ์ด๋ ๋ค๋ฅธ ๋๊ตฌ์์ ๋ค์ ์ฌ์ฉํ ์ ์์ต๋๋ค.++`url_element`์ ์งง์ CSS ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค. ์ค์ผ ์ ์์ผ๋ฉด ์ ์ฒด ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.+```python+>>> url_element = page.find({'href*': '/author/'})+>>> url_element.generate_css_selector+'body > div > div:nth-of-type(2) > div > div > span:nth-of-type(2) > a'+```+ํ์ด์ง ์์๋ถํฐ `url_element`๊น์ง์ ์ ์ฒด CSS ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.+```python+>>> url_element.generate_full_css_selector+'body > div > div:nth-of-type(2) > div > div > span:nth-of-type(2) > a'+```+`url_element`์ ์งง์ XPath ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค. ์ค์ผ ์ ์์ผ๋ฉด ์ ์ฒด ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.+```python+>>> url_element.generate_xpath_selector+'//body/div/div[2]/div/div/span[2]/a'+```+ํ์ด์ง ์์๋ถํฐ `url_element`๊น์ง์ ์ ์ฒด XPath ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.+```python+>>> url_element.generate_full_xpath_selector+'//body/div/div[2]/div/div/span[2]/a'+```+!!! abstract "์ฐธ๊ณ "++ ์งง์ ์ ํ์๋ฅผ ๋ง๋ค ๋ Scrapling์ `id` ์์ฑ์ด ์๋ ์์์ฒ๋ผ ๊ณ ์ ํ๊ฒ ์๋ณํ ์ ์๋ ์์๋ฅผ ์ฐพ์ ๊ฒฝ๋ก์ ์์์ ์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ์ด ์์์๋ ๊ทธ๋ฐ ์์๊ฐ ์์ด ์งง์ ์ ํ์์ ์ ์ฒด ์ ํ์๊ฐ ๊ฐ์ต๋๋ค.++## ์ ํ์์ ์ ๊ท์ ํจ๊ป ์ฌ์ฉํ๊ธฐ {#using-selectors-with-regular-expressions}+`parsel`/`scrapy`์ฒ๋ผ `re`์ `re_first`๋ก ์ ๊ท์์ ์ฌ์ฉํด ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ ์ ์์ต๋๋ค. ํ์ง๋ง Scrapling์์๋ `Selector`/`Selectors`/`TextHandler`, `TextHandlers` ๋ฑ ๊ฑฐ์ ๋ชจ๋ ํด๋์ค๊ฐ ์ด ๋ฉ์๋๋ฅผ ์ ๊ณตํฉ๋๋ค. ๋ฐ๋ผ์ ํ ์คํธ ๋ ธ๋๋ฅผ ์ ํํ์ง ์์๋ ์์์ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.++[TextHandler](main_classes.md#texthandler)๋ฅผ ์ค๋ช ํ ๋ ์์ธํ ๋ค๋ฃน๋๋ค. ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.+```python+>>> page.css('.price_color')[0].re_first(r'[\d\.]+')+'51.77'++>>> page.css('.price_color').re_first(r'[\d\.]+')+'51.77'++>>> page.css('.price_color').re(r'[\d\.]+')+['51.77',+ '53.74',+ '50.10',+ '47.82',+ '54.23',+...]++>>> page.css('.product_pod h3 a::attr(href)').re(r'catalogue/(.*)/index.html')+['a-light-in-the-attic_1000',+ 'tipping-the-velvet_999',+ 'soumission_998',+ 'sharp-objects_997',+...]++>>> filtering_function = lambda e: e.parent.tag == 'h3' and e.parent.parent.has_class('product_pod') # As above selector+>>> page.find('a', filtering_function).attrib['href'].re(r'catalogue/(.*)/index.html')+['a-light-in-the-attic_1000']++>>> page.find_by_text('Tipping the Velvet').attrib['href'].re(r'catalogue/(.*)/index.html')+['tipping-the-velvet_999']+```+์ด์ ๋๋ต์ ์ธ ์ฌ์ฉ๋ฒ์ ์ ์ ์์ ๊ฒ์ ๋๋ค. ๋ค์ ํ์ด์ง์์ [TextHandler](main_classes.md#texthandler)์ ํจ๊ป ๋ ์์ธํ ์ค๋ช ํ๊ฒ ์ต๋๋ค.\ No newline at end of filediff --git a/docs/locales/ko/spiders/advanced.md b/docs/locales/ko/spiders/advanced.mdnew file mode 100644index 0000000..0368900--- /dev/null+++ b/docs/locales/ko/spiders/advanced.md@@ -0,0 +1,430 @@+---+title: "ํฌ๋กค๋ง ์ ์ด: AutoThrottle, ์ฒดํฌํฌ์ธํธ, ์บ์, ์คํธ๋ฆฌ๋ฐ"+description: "ํฌ๋กค๋ง ์๋์ ๋์ ์์ฒญ์ ์ ์ดํ์ธ์. ์๋ต ์บ์, ์ผ์ ์ค์ง์ ์ฌ๊ฐ, ํญ๋ชฉ ์คํธ๋ฆฌ๋ฐ, ์ฒดํฌํฌ์ธํธ์ ์ ์ฅ๋๋ ์ํ๋ฅผ ์์๋ด ๋๋ค."+---++# ๊ณ ๊ธ ๊ธฐ๋ฅ {#advanced-usages}++## ์๊ฐ {#introduction}++!!! success "์์ ์ ํ์ธ"++ 1. [์์ํ๊ธฐ](getting-started.md)๋ฅผ ์ฝ๊ณ ๊ฐ๋จํ ์คํ์ด๋๋ฅผ ๋ง๋ค๊ณ ์คํํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.++์ด ํ์ด์ง๋ ๋์ ์์ฒญ ์ ์ด, ์ผ์ ์ค์ง์ ์ฌ๊ฐ, ์คํธ๋ฆฌ๋ฐ, ์๋ช ์ฃผ๊ธฐ ํ , ํต๊ณ, ๋ก๊น ๋ฑ ์คํ์ด๋์ ๊ณ ๊ธ ๊ธฐ๋ฅ์ ์ค๋ช ํฉ๋๋ค.++## ๋์ ์์ฒญ ์ ์ด {#concurrency-control}++๋ค์ ํด๋์ค ์์ฑ์ผ๋ก ํฌ๋กค๋ง ๋ถํ๋ฅผ ์กฐ์ ํฉ๋๋ค.++| ์์ฑ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|----------------------------------|---------|------------------------------------------------------------------|+| `concurrent_requests` | `4` | ๋์์ ์ฒ๋ฆฌํ ์ต๋ ์์ฒญ ์ |+| `concurrent_requests_per_domain` | `0` | ๋๋ฉ์ธ๋ณ ์ต๋ ๋์ ์์ฒญ ์์ ๋๋ค. 0์ ๋๋ฉ์ธ๋ณ ์ ํ์ด ์๋ค๋ ๋ป์ ๋๋ค |+| `download_delay` | `0.0` | ๊ฐ ์์ฒญ ์ ๋๊ธฐ ์๊ฐ(์ด) |+| `robots_txt_obey` | `False` | robots.txt์ Disallow, Crawl-delay, Request-rate ๊ท์น์ ์งํต๋๋ค |++```python+class PoliteSpider(Spider):+ name = "polite"+ start_urls = ["https://example.com"]++ # Be gentle with the server+ concurrent_requests = 4+ concurrent_requests_per_domain = 2+ download_delay = 1.0 # Wait 1 second between requests++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```++`concurrent_requests_per_domain`์ ์ค์ ํ๋ฉด ์ ์ฒด ์ ํ ์ธ์ ๋๋ฉ์ธ๋ณ ์ ํ์ด ์๊น๋๋ค. ์ฌ๋ฌ ๋๋ฉ์ธ์ ๋์์ ํฌ๋กค๋งํ ๋ ์ ์ฒด ์์ฒญ ์๋ ๋๊ฒ ์ ์งํ๋ฉด์ ๊ฐ ์ฌ์ดํธ์ ๋ถํ๋ฅผ ์ค์ผ ์ ์์ต๋๋ค.++!!! tip++ `download_delay`๋ ๋๋ฉ์ธ๊ณผ ๊ด๊ณ์์ด ๋ชจ๋ ์์ฒญ ์ ์ ๊ณ ์ ๋ ์๊ฐ์ ๊ธฐ๋ค๋ฆฝ๋๋ค. ๊ฐ๋จํ ์์ฒญ ๋น๋ ์ ํ์ ์ฌ์ฉํ์ธ์.++## AutoThrottle {#autothrottle}++๊ณ ์ ๋ `download_delay`๋ ์ง์ ์์ํด์ ์ ํด์ผ ํฉ๋๋ค. ๋๋ฌด ์งง์ผ๋ฉด ์ฐจ๋จ๋๊ณ ๋๋ฌด ๊ธธ๋ฉด ํฌ๋กค๋ง์ด ์ค๋ ๊ฑธ๋ฆฝ๋๋ค. AutoThrottle์ ์ค์ ์๋ต ์๋๋ฅผ ๋ณด๊ณ ๊ฐ ๋๋ฉ์ธ์ ์ง์ฐ์ ์กฐ์ ํฉ๋๋ค. ๋น ๋ฅธ ์๋ฒ์์๋ ์๋๋ฅผ ๋์ด๊ณ , ๋๋ฆฌ๊ฑฐ๋ ์์ฒญ์ ์ฐจ๋จํ๋ ์๋ฒ์์๋ ์๋๋ฅผ ์ค์ ๋๋ค.++| ์์ฑ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|------------------------------------|---------|-------------------------------------------------------------------|+| `autothrottle_enabled` | `False` | ์ ์ํ ์ง์ฐ์ ์ผญ๋๋ค |+| `autothrottle_start_delay` | `5.0` | ๋๋ฉ์ธ์ ์ฒซ ์์ฒญ์ ์ฌ์ฉํ ์ง์ฐ |+| `autothrottle_max_delay` | `60.0` | ํ์ฉ๋๋ ์ต๋ ์ง์ฐ |+| `autothrottle_target_concurrency` | `None` | ๋ชฉํ๋ก ํ๋ ๋๋ฉ์ธ๋ณ ๋์ ์์ฒญ ์์ ๋๋ค. ์๋ ์ค๋ช ์ ์ฐธ๊ณ ํ์ธ์ |+| `autothrottle_block_backoff` | `True` | ์ฐจ๋จ๋ ๋๋ง๋ค ํด๋น ๋๋ฉ์ธ์ ์ง์ฐ์ ๋ ๋ฐฐ๋ก ๋๋ฆฝ๋๋ค |++```python+class AdaptiveSpider(Spider):+ name = "adaptive"+ start_urls = ["https://example.com"]++ concurrent_requests = 8+ concurrent_requests_per_domain = 1++ autothrottle_enabled = True+ autothrottle_start_delay = 2.0+ autothrottle_max_delay = 30.0++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```++์๋ต์ ๋ฐ์ ๋๋ง๋ค ์ง์ฐ์ ์๋ฒ์ ์๋ต ์๊ฐ์ ๊ฐ๊น์์ง๋๋ค. ์ฌ์ดํธ๊ฐ 0.5์ด ์์ ์๋ตํ๋ฉด ์ง์ฐ๋ ์ฝ 0.5์ด๊ฐ ๋๋ฉฐ, ๋๋ต ์์ฒญ ํ๋์ฉ ์ฒ๋ฆฌํ๋ ์ํ๊ฐ ๋ฉ๋๋ค. ๋๋ฉ์ธ๋ณ ๋ชฉํ ์์ฒญ ์๋ ์ค์ ๋ `autothrottle_target_concurrency`, ๋ค์์ผ๋ก `concurrent_requests_per_domain`, ๋ ๋ค ์์ผ๋ฉด 1์ ์ฌ์ฉํฉ๋๋ค. ์ด๋ฏธ ์ค์ ํ ๋๋ฉ์ธ๋ณ ์ ํ์ด ๋ชฉํ๊ฐ ๋๊ณ ์ง์ฐ์ ๊ทธ ๊ฐ์ผ๋ก ๋๋๋ฏ๋ก, ๋ณดํต ๋ณ๋์ ๋ชฉํ๋ฅผ ์ง์ ํ ํ์๊ฐ ์์ต๋๋ค. ์๋ต ์๊ฐ์ด ๊ธ๊ฒฉํ ๋์ด๋๋ฉด ํ๊ท ์ ๊ธฐ๋ค๋ฆฌ์ง ์๊ณ ๋ฐ๋ก ๋ฐ์ํฉ๋๋ค. ๋ฐ๋ผ์ ์๋ฒ๊ฐ ๋๋ ค์ง๋ฉด ์ฆ์ ์๋๋ฅผ ์ค์ด๊ณ , ๋ค์ ๋นจ๋ผ์ง ๋๋ ์์ํ ์๋๋ฅผ ๋์ ๋๋ค.++### ์ฐจ๋จ๋ ๋ ์๋ ์ค์ด๊ธฐ {#backing-off-when-blocked}++์๋ต ์๊ฐ๋ง์ผ๋ก๋ ์์ฒญ ๋น๋ ์ ํ์ ์ ์ ์์ต๋๋ค. `429`, `403`, CAPTCHA ํ์ด์ง๋ ์ค์ ์ฝํ ์ธ ๋ณด๋ค *๋ ๋นจ๋ฆฌ* ๋์์ค๋ ๊ฒฝ์ฐ๊ฐ ๋ง์ต๋๋ค. ์๊ฐ๋ง ๋ณด๋ฉด ์๋๋ฅผ ๋์ฌ๋ ๋๋ค๊ณ ํ๋จํ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ ์ํ ์ฝ๋๊ฐ 2xx๊ฐ ์๋๊ฑฐ๋ `is_blocked()`๊ฐ ์ฐจ๋จ์ผ๋ก ํ๋จํ ์๋ต์ ๋๋ฉ์ธ์ ์ง์ฐ์ **๋ ๋ฐฐ๋ก ๋๋ฆฝ๋๋ค**.++```+0.5s -> 1s -> 2s -> 4s -> 8s ... (up to autothrottle_max_delay)+```++์ฌ์ดํธ๊ฐ ๊ณ์ ๊ฑฐ๋ถํ๋ฉด ์คํ์ด๋๋ ๊ณ์ ๋๋ ค์ง๋๋ค. ์ ์ ์๋ต์ด ๋์์ค๋ฉด ๋ค์ ํ๊ท ์ ์ ์ฉํด ์๋ฒ ์๋์ ๋ง๊ฒ ์ง์ฐ์ ๋ฎ์ถฅ๋๋ค. ๋ค์ ์์ํ์ง ์์๋ ์๋์ผ๋ก ํ๋ณตํฉ๋๋ค.++์ฌ์ดํธ๊ฐ `429` ๋๋ `503` ์๋ต์ `Retry-After` ํค๋๋ก ๋๊ธฐ ์๊ฐ์ ์๋ ค์ฃผ๋ฉด, ์ง์ฐ์ ๋ ๋ฐฐ๋ก ๋๋ฆฌ๋ ๋์ ๊ทธ ๊ฐ์ ์ฌ์ฉํฉ๋๋ค. ์ซ์ ํ์(`Retry-After: 120`)๊ณผ HTTP ๋ ์ง ํ์์ ๋ชจ๋ ์ดํดํฉ๋๋ค.++์ด ๊ธฐ๋ฅ์ ๋๋ ค๋ฉด `autothrottle_block_backoff = False`๋ฅผ ์ค์ ํ์ธ์. ์๋ต ์๊ฐ๋ง์ผ๋ก ์ง์ฐ์ ์กฐ์ ํ๋ฉฐ, ์ฐจ๋จ์ ์๋๊ฐ ๋ ๋นจ๋ผ์ง๋ ๊ฒ๋ง ๋ง์ต๋๋ค.++๋๋ฉ์ธ๋ณ ์ต์ข ์ง์ฐ์ ํต๊ณ์์ ํ์ธํ ์ ์์ต๋๋ค.++```python+result = AdaptiveSpider().start()+print(result.stats.autothrottle_delays) # {'example.com': 0.62}+```++!!! note "์ฐธ๊ณ "++ * `download_delay`์ robots.txt ์ง์ฐ์ ์ต์๊ฐ์ผ๋ก ์ฌ์ฉํ์ง๋ง, ์ด ๊ฐ๋ `autothrottle_max_delay`์ ์ ํ์ ๋ฐ์ต๋๋ค. ์ง์ผ์ผ ํ๋ ์ค์ ๋๋ robots.txt ์ง์ฐ ์ด์์ผ๋ก ์ต๋๊ฐ์ ์ ํ์ธ์.<br/>+ * `concurrent_requests_per_domain`์ ๋๋ฉ์ธ์ ๋์ ์์ฒญ ์๋ฅผ ์ ํํ๋ฉด์ AutoThrottle์ ๋ชฉํ๊ฐ ๋ฉ๋๋ค. ๋ณดํต ๋ชฉํ๋ฅผ ๋ฐ๋ก ์ค์ ํ ํ์๋ ์์ต๋๋ค. ์ด ๊ฐ์ ์ค์ ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์์ฒญ์ด ๋๋ฉ์ธ ์ง์ฐ์ ๊ธฐ๋ค๋ฆฌ๋ ๋์์๋ ์ ์ฒด ์ ํ์ ํ ์๋ฆฌ๋ฅผ ์ฐจ์งํ๊ธฐ ๋๋ฌธ์ ๋๋ค. ๋๋ฉ์ธ๋ณ ์ ํ์ด ์์ผ๋ฉด ๋๊ธฐ ์ค์ธ ์์ฒญ๋ค์ด ๋ค๋ฅธ ๋๋ฉ์ธ๊ณผ ๊ณต์ ํ๋ ์๋ฆฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค.<br/>+ * ์ธก์ ์๊ฐ์๋ ๋ด๋ถ ์ฌ์๋๋ฅผ ํฌํจํ ์ ์ฒด ๊ฐ์ ธ์ค๊ธฐ ์๊ฐ์ด ๋ค์ด๊ฐ๋๋ค. ๋ธ๋ผ์ฐ์ ์ธ์ ์์๋ ํ์ด์ง ๋ ๋๋ง ์๊ฐ๋ ํฌํจํฉ๋๋ค.<br/>+ * `autothrottle_max_delay`๋ `Retry-After`๋ฅผ ํฌํจํ ๋ชจ๋ ์ง์ฐ์ ์ ํํฉ๋๋ค. ์ฌ์ดํธ๊ฐ ๋ ์ค๋ ๊ธฐ๋ค๋ฆฌ๋ผ๊ณ ํ๋ฉด `autothrottle_max_delay`๋ฅผ ๋๋ฆฌ์ธ์.<br/>+ * ๊ณ์ฐ๋ ์ง์ฐ์ ์ฒดํฌํฌ์ธํธ์ ์ ์ฅํ์ง ์์ต๋๋ค. ์ผ์ ์ค์ง ํ ์ฌ๊ฐํ๋ฉด ๊ฐ ๋๋ฉ์ธ์ ๋ค์ `autothrottle_start_delay`๋ถํฐ ์์ํฉ๋๋ค.++## uvloop ์ฌ์ฉํ๊ธฐ {#using-uvloop}++`start()`์ `use_uvloop` ์ธ์๋ก ๋ ๋น ๋ฅธ [uvloop](https://github.com/MagicStack/uvloop)/[winloop](https://github.com/nicktimko/winloop) ์ด๋ฒคํธ ๋ฃจํ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ํด๋น ํจํค์ง๊ฐ ์ค์น๋์ด ์์ด์ผ ํฉ๋๋ค.++```python+result = MySpider().start(use_uvloop=True)+```++์ ์ถ๋ ฅ์ด ๋ง์ ํฌ๋กค๋ง์ ์ฒ๋ฆฌ๋์ ๋์ผ ์ ์์ต๋๋ค. `uvloop`(Linux/macOS) ๋๋ `winloop`(Windows)๋ฅผ ๋ณ๋๋ก ์ค์นํ์ธ์.++## ์ผ์ ์ค์ง์ ์ฌ๊ฐ {#pause-resume}++์คํ์ด๋๋ ์ฒดํฌํฌ์ธํธ๋ก ์์ ํ๊ฒ ์ผ์ ์ค์งํ๊ณ ์ฌ๊ฐํ ์ ์์ต๋๋ค. ์ฌ์ฉํ๋ ค๋ฉด ์์ฑ์์ `crawldir` ๋๋ ํฐ๋ฆฌ๋ฅผ ์ ๋ฌํ์ธ์.++```python+spider = MySpider(crawldir="crawl_data/my_spider")+result = spider.start()++if result.paused:+ print("Crawl was paused. Run again to resume.")+else:+ print("Crawl completed!")+```++### ๋์ ๋ฐฉ์ {#how-it-works}++1. **์ผ์ ์ค์ง**: ํฌ๋กค๋ง ์ค `Ctrl+C`๋ฅผ ๋๋ฅด์ธ์. ์คํ ์ค์ธ ์์ฒญ์ด ๋๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฐ ๋ค, ๋๊ธฐ ์์ฒญ๊ณผ ์ด๋ฏธ ํ์ธํ ์์ฒญ ์ง๋ฌธ ์งํฉ์ ์ฒดํฌํฌ์ธํธ๋ก ์ ์ฅํ๊ณ ์ข ๋ฃํฉ๋๋ค.+2. **๊ฐ์ ์ค์ง**: `Ctrl+C`๋ฅผ ๋ค์ ๋๋ฅด๋ฉด ์คํ ์ค์ธ ์์ ์ ๊ธฐ๋ค๋ฆฌ์ง ์๊ณ ๋ฐ๋ก ๋ฉ์ถฅ๋๋ค.+3. **์ฌ๊ฐ**: ๊ฐ์ `crawldir`๋ก ๋ค์ ์คํํ์ธ์. ์ฒดํฌํฌ์ธํธ๋ฅผ ์ฐพ์ ํ์ ์ง๋ฌธ ์งํฉ์ ๋ณต์ํ๊ณ , `start_requests()`๋ฅผ ๊ฑด๋๋ฐ์ด ์ค๋จํ ๊ณณ๋ถํฐ ๊ณ์ํฉ๋๋ค.+4. **์ ๋ฆฌ**: ์ผ์ ์ค์ง๊ฐ ์๋๋ผ ํฌ๋กค๋ง์ด ์ ์์ ์ผ๋ก ๋๋๋ฉด ์ฒดํฌํฌ์ธํธ ํ์ผ์ ์๋์ผ๋ก ์ญ์ ํฉ๋๋ค.++**ํฌ๋กค๋ง ์ค์๋ ์ฒดํฌํฌ์ธํธ๋ฅผ ์ฃผ๊ธฐ์ ์ผ๋ก ์ ์ฅํฉ๋๋ค. ๊ธฐ๋ณธ ๊ฐ๊ฒฉ์ 5๋ถ์ ๋๋ค.**++๊ฐ๊ฒฉ์ ๋ค์๊ณผ ๊ฐ์ด ๋ฐ๊ฟ ์ ์์ต๋๋ค.++```python+# Save checkpoint every 2 minutes+spider = MySpider(crawldir="crawl_data/my_spider", interval=120.0)+```++๋์คํฌ์ ์์์ ์ผ๋ก ์ฐ๋ฏ๋ก ์ผ๋ถ๋ง ๊ธฐ๋ก๋๋ ์ผ์ ๋ง์ต๋๋ค.++!!! tip++ `start()`๋ฅผ ์ฌ์ฉํ ๋ `Ctrl+C`๋ฅผ ๋๋ฅด๋ฉด ์ฒดํฌํฌ์ธํธ๋ฅผ ์ผ์ง ์์๋ ์งํ ์ค์ธ ์์ ์ ๋ง์น ๋ค ์ข ๋ฃํฉ๋๋ค. ๊ธฐ๋ค๋ฆฌ์ง ์๊ณ ๋ค์ ๋๋ฅด๋ฉด ์ฆ์ ๊ฐ์ ๋ก ์ข ๋ฃํฉ๋๋ค.++### ์ฌ๊ฐ ์ค์ธ์ง ํ์ธํ๊ธฐ {#knowing-if-youre-resuming}++`on_start()` ํ ์ `resuming` ํ๋๊ทธ๋ฅผ ๋ฐ์ต๋๋ค.++```python+async def on_start(self, resuming: bool = False):+ if resuming:+ self.logger.info("Resuming from checkpoint!")+ else:+ self.logger.info("Starting fresh crawl")+```++## ๊ฐ๋ฐ ๋ชจ๋ {#development-mode}++`parse()`๋ฅผ ์์ ํ ๋๋ง๋ค ์๋ฒ์ ์์ฒญํ๋ฉด ๋๋ฆฌ๊ณ ๋ถํ์ํ ๋ถํ๊ฐ ์๊น๋๋ค. ๊ฐ๋ฐ ๋ชจ๋๋ ์ฒซ ์คํ์์ ์๋ต์ ๋์คํฌ์ ์บ์ํ๊ณ , ๋ค์ ์คํ์์๋ ์ ์ฅ๋ ์๋ต์ ์ฌ์ฉํฉ๋๋ค. ๊ฐ์ ํ์ด์ง๋ฅผ ๋ค์ ๊ฐ์ ธ์ค์ง ์๊ณ ์ ํ์๋ฅผ ๋ฐ๊พธ๊ณ ์คํ์ด๋๋ฅผ ๋ฐ๋ณต ์คํํ ์ ์์ต๋๋ค.++์คํ์ด๋์ `development_mode = True`๋ฅผ ์ค์ ํ์ธ์.++```python+class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]+ development_mode = True++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```++์ฒซ ์คํ์ ์ ์์ ์ผ๋ก ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ ์๋ต์ ์ ์ฅํฉ๋๋ค. ๋ค์ ์คํ๋ถํฐ ๊ฐ์ ์์ฒญ์ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค์ง ์๊ณ ์บ์์์ ์ฒ๋ฆฌํฉ๋๋ค. `robots_txt_obey=True`์ด๋ฉด ์บ์๋ฅผ ์ฐพ๊ธฐ ์ ์ robots.txt๋ฅผ ํ์ธํฉ๋๋ค.++### ์บ์ ์์น {#cache-location}++๊ธฐ๋ณธ ์์น๋ ํ์ฌ ์์ ๋๋ ํฐ๋ฆฌ ์๋์ `.scrapling_cache/{spider.name}/`์ ๋๋ค. ์คํ์ด๋๋ฅผ ์คํํ ๋๋ ํฐ๋ฆฌ์ด๋ฉฐ, ์คํฌ๋ฆฝํธ ํ์ผ์ด ์๋ ์์น๊ฐ **์๋๋๋ค**. `development_cache_dir`๋ก ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.++```python+class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]+ development_mode = True+ development_cache_dir = "/tmp/my_spider_cache"+```++### ๋์ ๋ฐฉ์ {#how-it-works_1}++1. **์บ์ ํค**: ์์ฒญ ์ง๋ฌธ์ ์ฌ์ฉํฉ๋๋ค. ์ง๋ฌธ์ ์ํฅ์ ์ฃผ๋ ์์ฑ(`fp_include_kwargs`, `fp_include_headers`, `fp_keep_fragments`)์ ๋ฐ๊พธ๋ฉด ์๋ก ๊ฐ์ ธ์ต๋๋ค.+2. **์ ์ฅ ํ์**: ์๋ต๋ง๋ค `{fingerprint_hex}.json` ํ์ผ ํ๋๋ฅผ ๋ง๋ญ๋๋ค. ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ๋ฅผ ๊ทธ๋๋ก ๋ณด๊ดํ๋๋ก ๋ณธ๋ฌธ์ base64๋ก ์ธ์ฝ๋ฉํฉ๋๋ค. ์์ ํ์ผ์ ๋ง๋ ๋ค ์ด๋ฆ์ ๋ฐ๊พธ๋ ์์์ ์ฐ๊ธฐ๋ฅผ ์ฌ์ฉํฉ๋๋ค.+3. **์บ์ ์ฌ์ฉ**: ์บ์์ ์์ผ๋ฉด ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ์ ํจ๊ป `download_delay`, ์์ฒญ ๋น๋ ์ ํ, `is_blocked()` ์ฌ์๋ ๊ณผ์ ์ ๊ฑด๋๋๋๋ค. ์บ์๋ ์๋ต์ ์ฝ๋ฐฑ์ผ๋ก ๋ฐ๋ก ์ ๋ฌํฉ๋๋ค.+4. **ํต๊ณ**: ์บ์ ์์ฒญ๋ `requests_count`, `response_bytes`, ์ํ ์ฝ๋๋ณ ํ์์ ํฌํจ๋๋ฏ๋ก ์ผ๋ฐ ํฌ๋กค๋ง๊ณผ ๊ฐ์ ํต๊ณ๋ฅผ ๋ณผ ์ ์์ต๋๋ค. `cache_hits`์ `cache_misses`๋ก ์บ์ ์ฌ์ฉ ๊ฒฐ๊ณผ๋ ํ์ธํ ์ ์์ต๋๋ค.++### ์บ์ ์ง์ฐ๊ธฐ {#clearing-the-cache}++์บ์๋ ์๋์ผ๋ก ๋ง๋ฃ๋์ง ์์ต๋๋ค. ์๋ก ํฌ๋กค๋งํ๋ ค๋ฉด ์บ์ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ญ์ ํ๊ฑฐ๋ ๊ด๋ฆฌ์์ `clear()`๋ฅผ ์ง์ ํธ์ถํ์ธ์.++!!! warning++ ๊ฐ๋ฐ ๋ชจ๋๋ ๊ฐ๋ฐ ์ ์ฉ์ ๋๋ค. ์บ์ ์๋ต์ ๋ง๋ฃ๋์ง ์๊ณ , ์บ์ ์ฌ์ฉ ์ ์์ฒญ ๋น๋ ์ ํ๊ณผ ์ฐจ๋จ ์์ฒญ ์ฌ์๋๋ฅผ ๊ฑด๋๋๋๋ค. ์ด์ ํ๊ฒฝ์์๋ `development_mode = True`๋ฅผ ์ฌ์ฉํ์ง ๋ง์ธ์.++## ์คํธ๋ฆฌ๋ฐ {#streaming}++์ค๋ ์คํํ๋ ์คํ์ด๋๋ ์์งํ ํญ๋ชฉ์ ์ฆ์ ์ฌ์ฉํ๋ ์ฑ์์๋ `start()` ๋์ `stream()`์ ์ฌ์ฉํ์ธ์.++```python+import anyio++async def main():+ spider = MySpider()+ async for item in spider.stream():+ print(f"Got item: {item}")+ # Access real-time stats+ print(f"Items so far: {spider.stats.items_scraped}")+ print(f"Requests made: {spider.stats.requests_count}")++anyio.run(main)+```++`start()`์์ ์ฃผ์ ์ฐจ์ด๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++- `stream()`์ ๋น๋๊ธฐ ์ปจํ ์คํธ์์ ํธ์ถํด์ผ ํฉ๋๋ค.+- ํญ๋ชฉ์ ๋ฆฌ์คํธ์ ๋ชจ์ผ์ง ์๊ณ ์์งํ ๋๋ง๋ค ํ๋์ฉ ๋ด๋ณด๋ ๋๋ค.+- ๋ฐ๋ณต ์ค์ `spider.stats`๋ก ์ค์๊ฐ ํต๊ณ๋ฅผ ๋ณผ ์ ์์ต๋๋ค.++!!! abstract++ `spider.stats`์์ ํ์ธํ ์ ์๋ ์ ์ฒด ํต๊ณ๋ [์๋](#results-statistics)์ ์ค๋ช ๋์ด ์์ต๋๋ค.++์ฒดํฌํฌ์ธํธ์ ํจ๊ป ์ฌ์ฉํ ์๋ ์์ต๋๋ค. ์ค์๊ฐ ๋ฐ์ดํฐ๋ฅผ ๋ณด์ฌ์ฃผ๋ฉด์ ์ผ์ ์ค์ง์ ์ฌ๊ฐ๋ฅผ ์ง์ํ๋ UI๋ฅผ ์ฝ๊ฒ ๋ง๋ค ์ ์์ต๋๋ค.++```python+import anyio++async def main():+ spider = MySpider(crawldir="crawl_data/my_spider")+ async for item in spider.stream():+ print(f"Got item: {item}")+ # Access real-time stats+ print(f"Items so far: {spider.stats.items_scraped}")+ print(f"Requests made: {spider.stats.requests_count}")++anyio.run(main)+```+์ ์ฝ๋์์ `spider.pause()`๋ก ์คํ์ด๋๋ฅผ ์ข ๋ฃํ ์๋ ์์ต๋๋ค. ์ฒดํฌํฌ์ธํธ๋ฅผ ์ผ์ง ์์๋ค๋ฉด ํฌ๋กค๋ง๋ง ์ข ๋ฃํฉ๋๋ค.++## ์๋ช ์ฃผ๊ธฐ ํ {#lifecycle-hooks}++์ฌ๋ฌ ๋จ๊ณ์์ ์ํ๋ ๋์์ ์ถ๊ฐํ ์ ์๋๋ก ์ฌ์ ์ ๊ฐ๋ฅํ ํ ์ ์ ๊ณตํฉ๋๋ค.++### on_start {#on_start}++ํฌ๋กค๋ง ์ ์ ํธ์ถํฉ๋๋ค. ๋ฐ์ดํฐ ๋ก๋๋ ์์ ์ด๊ธฐํ ๊ฐ์ ์ค๋น ์์ ์ ์ฌ์ฉํ์ธ์.++```python+async def on_start(self, resuming: bool = False):+ self.logger.info("Spider starting up")+ # Load seed URLs from a database, initialize counters, etc.+```++### on_close {#on_close}++ํฌ๋กค๋ง์ด ์๋ฃ๋๊ฑฐ๋ ์ผ์ ์ค์ง๋ ๋ค ํธ์ถํฉ๋๋ค. ์์ ์ ๋ฆฌ์ ์ฌ์ฉํ์ธ์.++```python+async def on_close(self):+ self.logger.info("Spider shutting down")+ # Close database connections, flush buffers, etc.+```++### on_error {#on_error}++์์ฒญ์์ ์์ธ๊ฐ ๋ฐ์ํ๋ฉด ํธ์ถํฉ๋๋ค. ์ค๋ฅ ๊ธฐ๋ก์ด๋ ๋ณต๊ตฌ ์์ ์ ์ฌ์ฉํ์ธ์.++```python+async def on_error(self, request: Request, error: Exception):+ self.logger.error(f"Failed: {request.url} - {error}")+ # Log to error tracker, save failed URL for later, etc.+```++### on_scraped_item {#on_scraped_item}++์์งํ ๊ฐ ํญ๋ชฉ์ ๊ฒฐ๊ณผ์ ๋ฃ๊ธฐ ์ ์ ํธ์ถํฉ๋๋ค. ์ ์งํ๋ ค๋ฉด ์์ ์ฌ๋ถ์ ๊ด๊ณ์์ด ํญ๋ชฉ์ ๋ฐํํ๊ณ , ์ ์ธํ๋ ค๋ฉด `None`์ ๋ฐํํ์ธ์.++```python+async def on_scraped_item(self, item: dict) -> dict | None:+ # Drop items without a title+ if not item.get("title"):+ return None++ # Modify items (e.g., add timestamps)+ item["scraped_at"] = "2026-01-01"+ return item+```++!!! tip++ ์ด ํ ์ผ๋ก ํญ๋ชฉ์ ์ง์ ๋ง๋ ์ฒ๋ฆฌ ํ์ดํ๋ผ์ธ์ ์ ๋ฌํ ๋ค ์คํ์ด๋ ๊ฒฐ๊ณผ์์ ์ ์ธํ ์๋ ์์ต๋๋ค.++### start_requests {#start_requests}++`start_urls` ๋์ ์ํ๋ ๋ฐฉ์์ผ๋ก ์์ ์์ฒญ์ ๋ง๋ค๋ ค๋ฉด `start_requests()`๋ฅผ ์ฌ์ ์ํ์ธ์.++```python+async def start_requests(self):+ # POST request to log in first+ yield Request(+ "https://example.com/login",+ method="POST",+ data={"user": "admin", "pass": "secret"},+ callback=self.after_login,+ )++async def after_login(self, response: Response):+ # Now crawl the authenticated pages+ yield response.follow("/dashboard", callback=self.parse)+```++## ๊ฒฐ๊ณผ์ ํต๊ณ {#results-statistics}++`start()`๊ฐ ๋ฐํํ๋ `CrawlResult`์๋ ์์งํ ํญ๋ชฉ๊ณผ ์์ธํ ํต๊ณ๊ฐ ์์ต๋๋ค.++```python+result = MySpider().start()++# Items+print(f"Total items: {len(result.items)}")+result.items.to_json("output.json", indent=True)++# Did the crawl complete?+print(f"Completed: {result.completed}")+print(f"Paused: {result.paused}")++# Statistics+stats = result.stats+print(f"Requests: {stats.requests_count}")+print(f"Failed: {stats.failed_requests_count}")+print(f"Blocked: {stats.blocked_requests_count}")+print(f"Offsite filtered: {stats.offsite_requests_count}")+print(f"Robots.txt disallowed: {stats.robots_disallowed_count}")+print(f"Cache hits: {stats.cache_hits}")+print(f"Cache misses: {stats.cache_misses}")+print(f"Items scraped: {stats.items_scraped}")+print(f"Items dropped: {stats.items_dropped}")+print(f"Response bytes: {stats.response_bytes}")+print(f"Duration: {stats.elapsed_seconds:.1f}s")+print(f"Speed: {stats.requests_per_second:.1f} req/s")+```++### ์์ธํ ํต๊ณ {#detailed-stats}++`CrawlStats`๋ ๋ค์๊ณผ ๊ฐ์ ์ธ๋ถ ์ ๋ณด๋ฅผ ๊ธฐ๋กํฉ๋๋ค.++```python+stats = result.stats++# Status code distribution+print(stats.response_status_count)+# {'status_200': 150, 'status_404': 3, 'status_403': 1}++# Bytes downloaded per domain+print(stats.domains_response_bytes)+# {'example.com': 1234567, 'api.example.com': 45678}++# Requests per session+print(stats.sessions_requests_count)+# {'http': 120, 'stealth': 34}++# Proxies used during the crawl+print(stats.proxies)+# ['http://proxy1:8080', 'http://proxy2:8080']++# Log level counts+print(stats.log_levels_counter)+# {'debug': 200, 'info': 50, 'warning': 3, 'error': 1, 'critical': 0}++# Timing information+print(stats.start_time) # Unix timestamp when crawl started+print(stats.end_time) # Unix timestamp when crawl finished+print(stats.download_delay) # The download delay used (seconds)++# Concurrency settings used+print(stats.concurrent_requests) # Global concurrency limit+print(stats.concurrent_requests_per_domain) # Per-domain concurrency limit++# AutoThrottle+print(stats.autothrottle_enabled) # Whether the adaptive delay was on+print(stats.autothrottle_delays) # Final delay per domain, {'example.com': 0.62}++# Custom stats (set by your spider code)+print(stats.custom_stats)+# {'login_attempts': 3, 'pages_with_errors': 5}++# Export everything as a dict+print(stats.to_dict())+```++## ๋ก๊น {#logging}++์คํ์ด๋์ ๊ธฐ๋ณธ ๋ก๊ฑฐ๋ `self.logger`๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. ์คํ์ด๋ ์ด๋ฆ์ด ๋ฏธ๋ฆฌ ์ค์ ๋์ด ์๊ณ ๋ค์ ํญ๋ชฉ์ ๋ฐ๊ฟ ์ ์์ต๋๋ค.++| ์์ฑ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|-----------------------|--------------------------------------------------------------|----------------------------------------------------|+| `logging_level` | `logging.DEBUG` | ๊ธฐ๋กํ ์ต์ ๋ก๊ทธ ์์ค |+| `logging_format` | `"[%(asctime)s]:({spider_name}) %(levelname)s: %(message)s"` | ๋ก๊ทธ ๋ฉ์์ง ํ์ |+| `logging_date_format` | `"%Y-%m-%d %H:%M:%S"` | ๋ก๊ทธ ๋ฉ์์ง์ ๋ ์ง ํ์ |+| `log_file` | `None` | ์ฝ์ ์ถ๋ ฅ๊ณผ ํจ๊ป ์ฌ์ฉํ ๋ก๊ทธ ํ์ผ ๊ฒฝ๋ก |++```python+import logging++class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]+ logging_level = logging.INFO+ log_file = "logs/my_spider.log"++ async def parse(self, response: Response):+ self.logger.info(f"Processing {response.url}")+ yield {"title": response.css("title::text").get("")}+```++๋ก๊ทธ ํ์ผ์ ๋๋ ํฐ๋ฆฌ๊ฐ ์์ผ๋ฉด ์๋์ผ๋ก ๋ง๋ญ๋๋ค. ์ฝ์๊ณผ ํ์ผ์ ๊ฐ์ ์ถ๋ ฅ ํ์์ ์ฌ์ฉํฉ๋๋ค.diff --git a/docs/locales/ko/spiders/architecture.md b/docs/locales/ko/spiders/architecture.mdnew file mode 100644index 0000000..e168117--- /dev/null+++ b/docs/locales/ko/spiders/architecture.md@@ -0,0 +1,107 @@+---+title: "Scrapling ์น ํฌ๋กค๋ฌ์ ๋์ ๋ฐฉ์"+description: "์คํ์ด๋, ์์ฒญ, ์ธ์ , ์ค์ผ์ค๋ฌ, ํฌ๋กค๋ง ์์ง์ด ์ด๋ป๊ฒ ์ฐ๊ฒฐ๋๋์ง ์์๋ด ๋๋ค. Scrapy์ ๋น๊ตํ๊ณ ์์ํ ๋ฐฉ๋ฒ์ ์ ํํ์ธ์."+---++# ์คํ์ด๋ ์ํคํ ์ฒ {#spiders-architecture}++!!! success "์์ ์ ํ์ธ"++ 1. [Fetcher ๊ธฐ๋ณธ ์ฌํญ](../fetching/choosing.md)์ ์ฝ๊ณ Fetcher ์ข ๋ฅ์ ๊ฐ๊ฐ์ ์ฉ๋๋ฅผ ์ดํดํด์ผ ํฉ๋๋ค.+ 2. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector)์ [Response](../fetching/choosing.md#response-object) ํด๋์ค๋ฅผ ์ดํดํด์ผ ํฉ๋๋ค.++Scrapling์ ์คํ์ด๋ ์์คํ ์ Scrapy์์ ์์ด๋์ด๋ฅผ ์ป์ ๋น๋๊ธฐ ํฌ๋กค๋ง ํ๋ ์์ํฌ์ ๋๋ค. ์ฌ๋ฌ ์ธ์ ๊ณผ ๋์ ์์ฒญ, ์ผ์ ์ค์ง์ ์ฌ๊ฐ๋ฅผ ์ง์ํฉ๋๋ค. Scrapling์ ํ์ฑ ์์ง๊ณผ Fetcher๋ฅผ ํ๋์ ํฌ๋กค๋ง API๋ก ๋ฌถ๊ณ , ์์ฒญ ์์ฝ, ๋์ ์์ฒญ ์ ์ด, ์ฒดํฌํฌ์ธํธ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.++Scrapy์ ์ต์ํ๋ค๋ฉด ์ฝ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ฒ์ ์ฌ์ฉํ๋ ์ฌ๋๋ ์ดํดํ๊ธฐ ์ฝ๊ฒ ์ค๊ณํ์ต๋๋ค.++## ๋ฐ์ดํฐ ํ๋ฆ {#data-flow}++๋ค์ ๊ทธ๋ฆผ์ ํฌ๋กค๋ง ์ค ๋ฐ์ดํฐ๊ฐ ์ด๋ํ๋ ๊ณผ์ ์ ๋ณด์ฌ์ค๋๋ค.++<img src="../assets/spider_architecture.png" title="@TrueSkills๊ฐ ๋ง๋ ์คํ์ด๋ ์ํคํ ์ฒ ๊ทธ๋ฆผ" alt="@TrueSkills๊ฐ ๋ง๋ ์คํ์ด๋ ์ํคํ ์ฒ ๊ทธ๋ฆผ" style="width: 70%;"/>++์คํ์ด๋๋ฅผ ์คํํ๋ฉด ๋ค์ ์์๋ก ๋์ํฉ๋๋ค.++1. **์คํ์ด๋**๊ฐ ์ฒซ `Request` ๊ฐ์ฒด๋ค์ ๋ง๋ญ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก `start_urls`์ ๊ฐ URL๋ง๋ค ์์ฒญ ํ๋๋ฅผ ๋ง๋ญ๋๋ค. ๋ค๋ฅธ ๋ฐฉ์์ด ํ์ํ๋ฉด `start_requests()`๋ฅผ ์ฌ์ ์ํ ์ ์์ต๋๋ค.+2. **์ค์ผ์ค๋ฌ**๊ฐ ์์ฒญ์ ๋ฐ์ ์ฐ์ ์์ ํ์ ๋ฃ๊ณ ์์ฒญ์ ์ง๋ฌธ์ ๋ง๋ญ๋๋ค. ์ฐ์ ์์๊ฐ ๋์ ์์ฒญ๋ถํฐ ๊บผ๋ ๋๋ค.+3. **ํฌ๋กค๋ง ์์ง**์ด ์ ์ฒด ๋ฐ ๋๋ฉ์ธ๋ณ ๋์ ์์ฒญ ์ ํ๊ณผ ๋ค์ด๋ก๋ ์ง์ฐ์ ์งํค๋ฉด์ **์ค์ผ์ค๋ฌ**์ ๋ค์ ์์ฒญ์ ์์ฒญํฉ๋๋ค. `robots_txt_obey`๊ฐ ํ์ฑํ๋์ด ์์ผ๋ฉด ๋๋ฉ์ธ์ robots.txt ๊ท์น์ ๋จผ์ ํ์ธํ๊ณ , ๊ธ์ง๋ ์์ฒญ์ ์๋ฆผ ์์ด ์ ์ธํฉ๋๋ค. **ํฌ๋กค๋ง ์์ง**์ ๋ฐ์ ์์ฒญ์ **์ธ์ ๊ด๋ฆฌ์**์ ์ ๋ฌํฉ๋๋ค. ์ธ์ ๊ด๋ฆฌ์๋ ์์ฒญ์ `sid`(์ธ์ ID)๋ก ์ฌ์ฉํ ์ธ์ ์ ์ ํํฉ๋๋ค.+4. **์ธ์ **์ด ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ [Response](../fetching/choosing.md#response-object) ๊ฐ์ฒด๋ฅผ **ํฌ๋กค๋ง ์์ง**์ ๋ฐํํฉ๋๋ค. ์์ง์ ํต๊ณ๋ฅผ ๊ธฐ๋กํ๊ณ ์๋ต์ด ์ฐจ๋จ๋์๋์ง ํ์ธํฉ๋๋ค. ์ฐจ๋จ๋ ์์ฒญ์ ์ต๋ `max_blocked_retries`๋ฒ ์ฌ์๋ํฉ๋๋ค. ์ฐจ๋จ ๊ฐ์ง์ ์ฌ์๋ ๋ฐฉ์์ ๋ฐ๊ฟ ์ ์์ต๋๋ค.+5. **ํฌ๋กค๋ง ์์ง**์ด [Response](../fetching/choosing.md#response-object)๋ฅผ ์์ฒญ์ ์ฝ๋ฐฑ์ ์ ๋ฌํฉ๋๋ค. ์ฝ๋ฐฑ์ ์์งํ ํญ๋ชฉ์ ๋ํ๋ด๋ ๋์ ๋๋ฆฌ ๋๋ ๋ค์ ์์ฒญ์ ๋ด๋ณด๋ ๋๋ค. ๋ค์ ์์ฒญ์ ์ค์ผ์ค๋ฌ๋ก ์ ๋ฌ๋์ด ํ์ ๋ค์ด๊ฐ๋๋ค.+6. ํ๊ฐ ๋น๊ณ ์คํ ์ค์ธ ์์ ์ด ์์ด์ง๊ฑฐ๋ ์คํ์ด๋๋ฅผ ์ผ์ ์ค์งํ ๋๊น์ง 2๋จ๊ณ๋ถํฐ ๋ฐ๋ณตํฉ๋๋ค.+7. ์์ํ ๋ `crawldir`๋ฅผ ์ค์ ํ๋ค๋ฉด **ํฌ๋กค๋ง ์์ง**์ด ๋๊ธฐ ์ค์ธ ์์ฒญ๊ณผ ์ด๋ฏธ ํ์ธํ URL ์งํฉ์ ์ฒดํฌํฌ์ธํธ๋ก ์ฃผ๊ธฐ์ ์ผ๋ก ๋์คํฌ์ ์ ์ฅํฉ๋๋ค. ์ ์์ ์ธ ์ข ๋ฃ ์ ์ฐจ(Ctrl+C)์์๋ ๋ง์ง๋ง ์ฒดํฌํฌ์ธํธ๋ฅผ ์ ์ฅํฉ๋๋ค. ๊ฐ์ `crawldir`๋ก ๋ค์ ์คํํ๋ฉด `start_requests()`๋ฅผ ๊ฑด๋๋ฐ๊ณ ์ค์ผ์ค๋ฌ ์ํ๋ฅผ ๋ณต์ํ์ฌ ์ค๋จํ ๊ณณ๋ถํฐ ์ด์ด๊ฐ๋๋ค.+++## ๊ตฌ์ฑ ์์ {#components}++### Spider {#spider}++์ฌ์ฉ์๊ฐ ์ฃผ๋ก ๋ค๋ฃจ๋ ํด๋์ค์ ๋๋ค. `Spider`๋ฅผ ์์ํ๊ณ `start_urls`์ `parse()`๋ฅผ ์ ์ํฉ๋๋ค. ํ์ํ๋ฉด ์ธ์ ์ ์ค์ ํ๊ณ ์๋ช ์ฃผ๊ธฐ ํ ์ ์ฌ์ ์ํฉ๋๋ค.++```python+from scrapling.spiders import Spider, Response, Request++class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]++ async def parse(self, response: Response):+ for link in response.css("a::attr(href)").getall():+ yield response.follow(link, callback=self.parse_page)++ async def parse_page(self, response: Response):+ yield {"title": response.css("h1::text").get("")}+```++### ํฌ๋กค๋ง ์์ง {#crawler-engine}++์ ์ฒด ํฌ๋กค๋ง์ ๊ด๋ฆฌํฉ๋๋ค. ๋ฉ์ธ ๋ฃจํ์ ๋์ ์์ฒญ ์ ํ์ ๊ด๋ฆฌํ๊ณ , ์ธ์ ๊ด๋ฆฌ์๋ฅผ ํตํด ์์ฒญ์ ๋ณด๋ด๊ณ , ์ฝ๋ฐฑ ๊ฒฐ๊ณผ๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค. ์ง์ ๋ค๋ฃฐ ํ์๋ ์์ต๋๋ค. `Spider.start()`์ `Spider.stream()`์ด ๋์ ์ฒ๋ฆฌํฉ๋๋ค.++### ์ค์ผ์ค๋ฌ {#scheduler}++URL ์ค๋ณต ์ ๊ฑฐ ๊ธฐ๋ฅ์ด ์๋ ์ฐ์ ์์ ํ์ ๋๋ค. ์์ฒญ์ URL, HTTP ๋ฉ์๋, ๋ณธ๋ฌธ, ์ธ์ ID๋ก ์ง๋ฌธ์ ๊ณ์ฐํฉ๋๋ค. ์ฒดํฌํฌ์ธํธ๋ฅผ ์ํ `snapshot()`๊ณผ `restore()`๋ฅผ ์ง์ํ๋ฏ๋ก ํฌ๋กค๋ง ์ํ๋ฅผ ์ ์ฅํ๊ณ ๋ณต์ํ ์ ์์ต๋๋ค.++### ์ธ์ ๊ด๋ฆฌ์ {#session-manager}++์ด๋ฆ์ด ์ง์ ๋ ์ธ์ ์ธ์คํด์ค๋ฅผ ํ๋ ์ด์ ๊ด๋ฆฌํฉ๋๋ค. ์ธ์ ์ ๋ค์ ์ข ๋ฅ ์ค ํ๋์ ๋๋ค.++- [FetcherSession](../fetching/static.md)+- [AsyncStealthySession](../fetching/stealthy.md)++์์ฒญ์ ๋ฐ์ผ๋ฉด `sid` ํ๋๋ก ์๋ง์ ์ธ์ ์ ์ ํํฉ๋๋ค. ์ธ์ ์ ๊ธฐ๋ณธ์ ์ผ๋ก ์คํ์ด๋์ ํจ๊ป ์์ํ์ง๋ง, ์ฒ์ ์ฌ์ฉํ ๋ ์์ํ๋๋ก ์ค์ ํ ์๋ ์์ต๋๋ค.++### ์ฒดํฌํฌ์ธํธ ์์คํ {#checkpoint-system}++์ ํ์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋ ๊ธฐ๋ฅ์ ๋๋ค. ๋๊ธฐ ์ค์ธ ์์ฒญ๊ณผ ์ด๋ฏธ ํ์ธํ URL ์ง๋ฌธ ๋ฑ ํฌ๋กค๋ฌ ์ํ๋ฅผ ๋์คํฌ์ pickle ํ์ผ์ ์ ์ฅํฉ๋๋ค. ์์ ํ์ผ์ ๋ง๋ ๋ค ์ด๋ฆ์ ๋ฐ๊พธ๋ ์์์ ์ฐ๊ธฐ๋ก ๋ฐ์ดํฐ ์์์ ๋ฐฉ์งํฉ๋๋ค. ์ฒดํฌํฌ์ธํธ๋ ์ค์ ํ ๊ฐ๊ฒฉ๊ณผ ์ ์์ ์ธ ์ข ๋ฃ ์ ์ฐจ์์ ์ ์ฅ๋ฉ๋๋ค. ์ผ์ ์ค์ง๊ฐ ์๋ ์ฑ๊ณต์ ์ธ ํฌ๋กค๋ง ์๋ฃ ํ์๋ ํ์ผ์ด ์๋์ผ๋ก ์ญ์ ๋ฉ๋๋ค.++### ์๋ต ์บ์ {#response-cache}++๊ฐ๋ฐ ๋ชจ๋์์ ์ฌ์ฉํ ์ ์๋ ์ ํ์ ์บ์์ ๋๋ค. ๊ฐ์ ธ์จ ์๋ต์ ๋์คํฌ์ ์ ์ฅํ๊ณ ๋ค์ ์คํ์์ ๋ค์ ์ฌ์ฉํฉ๋๋ค. ๊ฐ ์๋ต์ ์์ฒญ ์ง๋ฌธ์ ํค๋ก ์ผ์ JSON์ผ๋ก ์ ์ฅํฉ๋๋ค. ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ๊ฐ ์ ์ง๋๋๋ก ๋ณธ๋ฌธ์ base64๋ก ์ธ์ฝ๋ฉํฉ๋๋ค. ์๋ฒ์ ๋ค์ ์์ฒญํ์ง ์๊ณ `parse()`๋ฅผ ์์ ํ๊ธฐ ์ํ ๊ธฐ๋ฅ์ด๋ฉฐ, ์ด์ ํ๊ฒฝ์ฉ์ด ์๋๋๋ค.++### ์ถ๋ ฅ {#output}++์์งํ ํญ๋ชฉ์ `ItemList`์ ๋ชจ์ ๋๋ค. ๋ฆฌ์คํธ๋ฅผ ์์ํ๋ฉฐ `to_json()`, `to_jsonl()`, `to_csv()`, `to_xml()` ๋ด๋ณด๋ด๊ธฐ ๋ฉ์๋๋ฅผ ์ ๊ณตํฉ๋๋ค. ํฌ๋กค๋ง ํต๊ณ๋ ์ ์ฉํ ์ ๋ณด๋ฅผ ๋ด์ `CrawlStats` dataclass์ ๊ธฐ๋กํฉ๋๋ค.+++## Scrapy์ ๋น๊ต {#comparison-with-scrapy}++Scrapy๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ๋ค์ ํ๋ก ๊ธฐ๋ฅ์ ๋น๊ตํ ์ ์์ต๋๋ค.++| ๊ฐ๋ | Scrapy | Scrapling |+|--------------------|-------------------------------|-----------------------------------------------------------------|+| ์คํ์ด๋ ์ ์ | `scrapy.Spider` ์์ | `scrapling.spiders.Spider` ์์ |+| ์์ ์์ฒญ | `start_requests()` | `async start_requests()` |+| ์ฝ๋ฐฑ | `def parse(self, response)` | `async def parse(self, response)` |+| ๋งํฌ ๋ฐ๋ผ๊ฐ๊ธฐ | `response.follow(url)` | `response.follow(url)` |+| ํญ๋ชฉ ์ถ๋ ฅ | `yield dict` ๋๋ `yield Item` | `yield dict` |+| ์์ฒญ ์์ฝ | Scheduler + Dupefilter | ์ค๋ณต ์ ๊ฑฐ ๊ธฐ๋ฅ์ด ์๋ ์ค์ผ์ค๋ฌ |+| ๋ค์ด๋ก๋ | Downloader + Middlewares | ์ฌ๋ฌ ์ธ์ ์ ์ง์ํ๋ ์ธ์ ๊ด๋ฆฌ์ |+| ํญ๋ชฉ ์ฒ๋ฆฌ | Item Pipelines | `on_scraped_item()` ํ |+| ์ฐจ๋จ ๊ฐ์ง | ์ฌ์ฉ์ ์ ์ ๋ฏธ๋ค์จ์ด | ๊ธฐ๋ณธ ์ ๊ณต `is_blocked()` + `retry_blocked_request()` ํ |+| ๋์ ์์ฒญ | `CONCURRENT_REQUESTS` ์ค์ | `concurrent_requests` ํด๋์ค ์์ฑ |+| ๋๋ฉ์ธ ์ ํ | `allowed_domains` | `allowed_domains` |+| Robots.txt | `ROBOTSTXT_OBEY` ์ค์ | `robots_txt_obey` ํด๋์ค ์์ฑ |+| ์ผ์ ์ค์ง์ ์ฌ๊ฐ | `JOBDIR` ์ค์ | `crawldir` ์์ฑ์ ์ธ์ |+| ๋ด๋ณด๋ด๊ธฐ | Feed exports | `result.items.to_json()` / `to_jsonl()` / `to_csv()` / `to_xml()` ๋๋ ํ ์ ํตํ ์ฌ์ฉ์ ์ ์ ๋ด๋ณด๋ด๊ธฐ |+| ์คํ | `scrapy crawl spider_name` | `MySpider().start()` |+| ์คํธ๋ฆฌ๋ฐ | ์ง์ ์ ํจ | `async for item in spider.stream()` |+| ์ฌ๋ฌ ์ธ์ | ์ง์ ์ ํจ | ์คํ์ด๋ ํ๋์์ ์ฌ๋ฌ ์ข ๋ฅ์ ์ธ์ ์ฌ์ฉ |diff --git a/docs/locales/ko/spiders/generic-templates.md b/docs/locales/ko/spiders/generic-templates.mdnew file mode 100644index 0000000..23ab804--- /dev/null+++ b/docs/locales/ko/spiders/generic-templates.md@@ -0,0 +1,278 @@+---+title: "๋งํฌ, ์ฌ์ดํธ๋งต, ํผ๋, Markdown์ฉ ์คํ์ด๋ ํ ํ๋ฆฟ"+description: "CrawlSpider, SitemapSpider, XMLFeedSpider, CSVFeedSpider, ContentSpider ์ค์์ ์ ํํ์ธ์. ํ์ด์ง, ํผ๋ ํญ๋ชฉ, Markdown ๋ฌธ์๋ฅผ ์์งํ ๊ท์น์ ์ค์ ํฉ๋๋ค."+---++# ์ผ๋ฐ ์คํ์ด๋ ํ ํ๋ฆฟ {#generic-spider-templates}++๋๋ถ๋ถ์ ํฌ๋กค๋ง์ ํน์ ํจํด์ ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ๊ฑฐ๋ ์ฌ์ดํธ๋งต์ ์๋ ๋ชจ๋ URL์ ๋ฐฉ๋ฌธํฉ๋๋ค. Scrapling์ ๋ ๋ฐฉ์์ ํ ํ๋ฆฟ์ ์ ๊ณตํ๋ฏ๋ก ๊ฐ์ `parse()` ์ฝ๋๋ฅผ ๋งค๋ฒ ์์ฑํ ํ์๊ฐ ์์ต๋๋ค.++`CrawlSpider`์ `SitemapSpider`๋ `LinkExtractor`๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ด ํด๋์ค๋ `Response`์์ URL์ ์ถ์ถํ๊ฑฐ๋ `matches()`๋ก URL ํ๋๋ฅผ ๊ฒ์ฌํฉ๋๋ค. `SitemapSpider`๋ gzip ์์ถ ์ฌ๋ถ์ ๊ด๊ณ์์ด sitemap.xml / sitemap_index.xml ๋ณธ๋ฌธ๋ ๋ด๋ถ์์ ํ์ฑํฉ๋๋ค.++์ผ๋ฐ `Spider.parse()` ์์์ `LinkExtractor`๋ฅผ ์ง์ ์ฌ์ฉํ ์๋ ์์ต๋๋ค. ํ ํ๋ฆฟ์ ์ด ์ฐ๊ฒฐ ์์ ์ ๋์ ํด ์ค ๋ฟ์ ๋๋ค.++## CrawlSpider {#crawlspider}++`CrawlSpider`๋ ์ ์ธํ ๊ท์น์ ๋ฐ๋ผ ๋งํฌ๋ฅผ ์๋์ผ๋ก ๋ฐ๋ผ๊ฐ๋๋ค.++```python+from scrapling.spiders import CrawlSpider, CrawlRule, LinkExtractor++class QuotesSpider(CrawlSpider):+ name = "blog"+ start_urls = ["https://quotes.toscrape.com/"]++ def rules(self):+ return [+ CrawlRule(LinkExtractor(allow=r"/author/"), callback=self.parse_author),+ CrawlRule(LinkExtractor(allow=r"/page/\d+/")), # follow pagination, no callback+ ]++ async def parse_author(self, response):+ yield {+ '.author-title': response.css('.author-title::text').get(),+ "birthday": response.css('.author-born-date::text').get(),+ "url": response.url,+ }++result = QuotesSpider().start()+```++`CrawlRule`์ `LinkExtractor`์ ์ ํ์ `callback`(์คํ์ด๋์ ๋ฐ์ธ๋ฉ๋ ๋ฉ์๋), ์์ฑํ `Request`์ ์ ํ์ `priority`, ์ ํ์ `process_request`๋ฅผ ์ฐ๊ฒฐํฉ๋๋ค. ๋ง์ง๋ง ์ธ์๋ ๊ฐ `Request`๋ฅผ ๋ด๋ณด๋ด๊ธฐ ์ ์ ์์ ํ๋ ๋ฐ์ธ๋ฉ๋ ๋ฉ์๋์ ๋๋ค. ๊ธฐ๋ณธ `parse()`๋ ๋ชจ๋ ์๋ต์ ๋ชจ๋ ๊ท์น์ ์ ์ฉํ๊ณ , ์ผ์นํ๋ URL๋ง๋ค `Request`๋ฅผ ๋ด๋ณด๋ ๋๋ค.++๊ท์น์ ์ฝ๋ฐฑ์ด ์์ผ๋ฉด ํด๋น URL์ ์คํ์ด๋์ ๊ธฐ๋ณธ `parse()`๋ก ์ ๋ฌํฉ๋๋ค. ๋ค์ ํ์ด์ง ๋งํฌ๋ฅผ ์ถ์ถํด ๋ณ๋ ์ฝ๋ฐฑ ์์ด ๊ณ์ ๋ฐฉ๋ฌธํ ์ ์์ผ๋ฏ๋ก ํ์ด์ง ๋๋๊ธฐ์ ์ ์ฉํฉ๋๋ค.++### ํฌ๋กค๋ง ์์ {#crawl-order}++`CrawlSpider`๋ `ContentSpider`๋ฅผ ํฌํจํ ํ์ ํด๋์ค์์ `crawl_strategy`๋ฅผ ์ค์ ํด ๋๊ธฐ ์์ฒญ์ ์์๋ฅผ ์ ํํ์ธ์.++| `crawl_strategy` | ๊ฐ์ `Request.priority` ์์์์ ์์ |+|------------------|------------------------------------------|+| `"bfs"`(๊ธฐ๋ณธ๊ฐ) | ํ์ ๋จผ์ ๋ค์ด์จ ์์ฒญ๋ถํฐ |+| `"dfs"` | ํ์ ๋์ค์ ๋ค์ด์จ ์์ฒญ๋ถํฐ |++์ค์ผ์ค๋ฌ๋ `Request.priority`๊ฐ ๋์ ๋๊ธฐ ์์ฒญ์ ๋จผ์ ์ ํํฉ๋๋ค. ์ ๋ต์ ์ฐ์ ์์๊ฐ ๊ฐ์ ์์ฒญ ์ฌ์ด์ ์์๋ง ์ ํฉ๋๋ค.++์ ํํ ํ ์์๋๋ก ์์ฒญ์ ํ๋์ฉ ์ฒ๋ฆฌํ๋ ค๋ฉด `concurrent_requests = 1`์ ์ค์ ํ์ธ์. ์ค๋ณต URL์ ๊ณ์ ์ ์ธํ๋ฉฐ, ๊ฐ์ URL์ ๋ค์ ๋ฐ๊ฒฌํด๋ ํ์ ์๋ ์์ฒญ์ ์์น๋ ๋ฐ๋์ง ์์ต๋๋ค. ๋์ ์์ฒญ์ ์ฌ์ฉํ๋ฉด ํ์ด์ง๊ฐ ๋๋๋ ์์๊ฐ ๋ฌ๋ผ์ง๊ณ , ํ์ ๋จ๊ณ๋ ๋ถ๊ธฐ๊ฐ ๊ฒน์น ์ ์์ต๋๋ค.++์ฒดํฌํฌ์ธํธ์์ ์ฌ๊ฐํ ๋๋ ๊ฐ์ `crawl_strategy`๋ฅผ ์ ์งํ์ธ์.++### ๊ท์น์ ์ํ๋ ๋์ ๋ํ๊ธฐ {#combining-rules-with-custom-logic}++`parse()`๋ฅผ ์ฌ์ ์ํ๊ณ `super().parse(response)`๋ฅผ ํธ์ถํ๋ฉด ๊ท์น์ ๋ฐ๋ฅธ ๋์๊ณผ ์ง์ ๋ด๋ณด๋ด๋ ๊ฒฐ๊ณผ๋ฅผ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.++```python+class MySpider(CrawlSpider):+ def rules(self):+ return [CrawlRule(LinkExtractor(allow=r"/posts/"), callback=self.parse_post)]++ async def parse(self, response):+ yield {"page_url": response.url}+ async for req in super().parse(response):+ yield req+```++### `process_request`๋ก ์์ฒญ ๋ฐ๊พธ๊ธฐ {#mutating-requests-with-process_request}++```python+def add_priority(self, request, response):+ request.priority = 10+ return request++def rules(self):+ return [CrawlRule(+ LinkExtractor(allow=r"/posts/"),+ callback=self.parse_post,+ process_request=self.add_priority,+ )]+```++## SitemapSpider {#sitemapspider}++`SitemapSpider`๋ sitemap.xml์ URL์์ ํฌ๋กค๋ง์ ์์ํฉ๋๋ค. `CrawlSpider`์ ๊ฐ์ `rules()` API๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ๋์ ๋ฐฉ์์ ํจ๊ป ์ดํดํ ์ ์์ต๋๋ค.++```python+from scrapling.spiders import SitemapSpider, CrawlRule, LinkExtractor++class MySitemap(SitemapSpider):+ name = "sm"+ sitemap_urls = ["https://example.com/sitemap.xml"]++ def rules(self):+ return [+ CrawlRule(LinkExtractor(allow=r"/posts/"), callback=self.parse_post),+ CrawlRule(LinkExtractor(allow=r"/products/"), callback=self.parse_product),+ ]++ async def parse_post(self, response):+ yield {"title": response.css("h1::text").get()}++ async def parse_product(self, response):+ yield {"sku": response.css(".sku::text").get()}++result = MySitemap().start()+```++### URL์ ์ฝ๋ฐฑ์ผ๋ก ์ ๋ฌํ๋ ๋ฐฉ์ {#how-urls-are-dispatched}++`SitemapSpider`๋ ์ฌ์ดํธ๋งต์ URL๋ง๋ค ๊ฐ ๊ท์น์ `LinkExtractor.matches(url)`์ ์์๋๋ก ํ์ธํฉ๋๋ค. ์ฒ์ ์ผ์นํ ๊ท์น์ ์ ํํ๊ณ , ๊ทธ ์ฝ๋ฐฑ์ ๊ฐ์ง `Request`๋ฅผ ๋ด๋ณด๋ ๋๋ค. `rules()`๊ฐ ๋น์ด ์์ง ์์๋ฐ ์ผ์นํ๋ ๊ท์น์ด ์์ผ๋ฉด URL์ ์ ์ธํฉ๋๋ค. `rules()`๊ฐ ๋น ๋ฆฌ์คํธ์ด๋ฉด ๋ชจ๋ URL์ ์คํ์ด๋์ `parse()`๋ก ์ ๋ฌํฉ๋๋ค. ์ด ๋ฉ์๋๋ ์ฌ์ ์ํ์ง ์์ผ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก `NotImplementedError`๋ฅผ ๋ฐ์์ํต๋๋ค.++### ์ฌ์ดํธ๋งต ์ธ๋ฑ์ค {#sitemap-indexes}++`SitemapSpider`๊ฐ ์ฌ์ดํธ๋งต ๋ชฉ๋ก์ธ `<sitemapindex>`๋ฅผ ๋ง๋๋ฉด ํ์ ์ฌ์ดํธ๋งต์ ์๋์ผ๋ก ๋ฐฉ๋ฌธํฉ๋๋ค. ๋ฐฉ๋ฌธํ ํ์ ์ฌ์ดํธ๋งต์ ์ ํํ๋ ค๋ฉด `sitemap_follow`์ `LinkExtractor`๋ฅผ ์ค์ ํ์ธ์.++```python+class MySitemap(SitemapSpider):+ name = "sm"+ sitemap_urls = ["https://example.com/sitemap.xml"]+ sitemap_follow = LinkExtractor(allow=r"/posts-sitemap-\d+\.xml") # only post sitemaps+```++### robots.txt ์ง์ {#robotstxt-support}++`robots.txt` URL์ `sitemap_urls`์ ๋ฐ๋ก ๋ฃ์ผ๋ฉด `SitemapSpider`๊ฐ ํ์ผ์ ์์๋ณด๊ณ , ๋์ด๋ ๋ชจ๋ ์ฌ์ดํธ๋งต์ ์ถ์ถํด ๋ฐฉ๋ฌธํฉ๋๋ค.++```python+class MySitemap(SitemapSpider):+ name = "sm"+ sitemap_urls = ["https://example.com/robots.txt"]+```++### ๋ค๋ฅธ ์ธ์ด์ URL {#alternate-language-urls}++`sitemap_alternate_links = True`๋ฅผ ์ค์ ํ๋ฉด `<xhtml:link rel="alternate" hreflang="...">`์ URL๋ ๊ท์น์ผ๋ก ์ฒ๋ฆฌํฉ๋๋ค.++## XMLFeedSpider {#xmlfeedspider}++`XMLFeedSpider`๋ RSS, Atom, ์ํ ํผ๋ ๋ฑ XML ํผ๋์ ๋ ธ๋๋ฅผ ์ํํฉ๋๋ค. `itertag`์ ์ํ๋ ๋ ธ๋ ์ด๋ฆ์ ์ค์ ํ๊ณ (๊ธฐ๋ณธ๊ฐ: `"item"`), ์ผ์นํ๋ ๋ ธ๋๋ง๋ค ํธ์ถํ `parse_node()`๋ฅผ ์ฌ์ ์ํ์ธ์.++```python+from scrapling.spiders import XMLFeedSpider++class RSSSpider(XMLFeedSpider):+ name = "rss"+ start_urls = ["https://example.com/feed.xml"]+ itertag = "item"++ async def parse_node(self, response, node):+ yield {+ "title": node.findtext("title"),+ "link": node.findtext("link"),+ "date": node.findtext("pubDate"),+ }++result = RSSSpider().start()+```++๋ค๋ฅธ ์ฝ๋ฐฑ์ฒ๋ผ `parse_node()`๋ `Request`๋ฅผ ๋ด๋ณด๋ผ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด `response.follow(node.findtext("link"), callback=self.parse_post)`๋ก ํผ๋๊ฐ ๊ฐ๋ฆฌํค๋ ํ์ด์ง๋ฅผ ๋ฐฉ๋ฌธํ ์ ์์ต๋๋ค.++### ๋ ธ๋ ์ ํ๊ณผ ํ์ฑ {#how-nodes-are-matched-and-parsed}++`parse_node()`์ ์ ๋ฌํ๋ ๋ ธ๋๋ ๋ค์์คํ์ด์ค๋ฅผ ๋ชจ๋ ์ ๊ฑฐํ `lxml` ์์์ ๋๋ค. ๋ฐ๋ผ์ `node.findtext("title")`, `node.find("thumbnail").get("url")`, ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ๋ `node.xpath(...)`๋ฅผ ์ด๋ค ํผ๋์์๋ ๋ค์์คํ์ด์ค ๋งคํ ์์ด ์ฌ์ฉํ ์ ์์ต๋๋ค. `"entry"`์ฒ๋ผ ๋จ์ํ `itertag`๋ ๋ค์์คํ์ด์ค์ ๊ด๊ณ์์ด ์ด๋ฆ์ผ๋ก ๋ ธ๋๋ฅผ ์ฐพ์ต๋๋ค. Atom๊ณผ ๋๋ถ๋ถ์ ๋ค์์คํ์ด์ค๊ฐ ์๋ ํผ๋์ ์ ํฉํฉ๋๋ค. ํน์ ๋ค์์คํ์ด์ค์ ๋ ธ๋๋ง ์ฐพ์ผ๋ ค๋ฉด ์ ๋์ฌ๊ฐ ์๋ `itertag`๋ฅผ ์ฌ์ฉํ๊ณ `namespaces`์ ์ ๋์ฌ๋ฅผ ์ ์ํ์ธ์.++```python+class ThumbnailSpider(XMLFeedSpider):+ name = "thumbs"+ start_urls = ["https://example.com/feed.xml"]+ itertag = "media:thumbnail"+ namespaces = (("media", "http://search.yahoo.com/mrss/"),)++ async def parse_node(self, response, node):+ yield {"thumbnail": node.get("url")}+```++gzip ํผ๋(`.xml.gz` ๋๋ gzip ์ฝํ ์ธ ํ์ ์ผ๋ก ์ ๊ณต๋๋ ํผ๋)๋ ์ฌ์ดํธ๋งต ์คํ์ด๋์ ๊ฐ์ ๋ณดํธ ๊ธฐ๋ฅ์ผ๋ก ์๋ ์์ถ ํด์ ํฉ๋๋ค. ์๋ชป๋ XML์ ํฌ๋กค๋ง์ ์ค๋จํ์ง ์๊ณ ๊ฒฝ๊ณ ๋ฅผ ๊ธฐ๋กํฉ๋๋ค.++## CSVFeedSpider {#csvfeedspider}++`CSVFeedSpider`๋ CSV ํผ๋์ ํ์ ์ํํฉ๋๋ค. ์ด ์ด๋ฆ์ ํค๋ก ํ๋ ๋์ ๋๋ฆฌ๋ก ๊ฐ ํ์ ๋ฐ๋ `parse_row()`๋ฅผ ์ฌ์ ์ํ์ธ์.++```python+from scrapling.spiders import CSVFeedSpider++class PriceSpider(CSVFeedSpider):+ name = "prices"+ start_urls = ["https://example.com/products.csv"]++ async def parse_row(self, response, row):+ yield {"product": row["title"], "price": float(row["price"])}++result = PriceSpider().start()+```++๊ธฐ๋ณธ์ ์ผ๋ก ์ฒซ ํ์ ํค๋๋ก ์ฌ์ฉํฉ๋๋ค. ํค๋ ํ์ด ์์ผ๋ฉด `headers`์ ์ด ์ด๋ฆ์ ์ง์ ์ง์ ํ์ธ์. ํ์ค ์ผํ ํ์์ด ์๋๋ผ๋ฉด `delimiter`/`quotechar`๋ฅผ ์ค์ ํ์ธ์.++```python+class PriceSpider(CSVFeedSpider):+ name = "prices"+ start_urls = ["https://example.com/products.csv"]+ headers = ["title", "price", "url"]+ delimiter = ";"+```++์์ **XMLFeedSpider**์ฒ๋ผ gzip ํผ๋๋ ์๋์ผ๋ก ์์ถ ํด์ ํฉ๋๋ค.++<a id="sitetomarkdownspider"></a>++## ContentSpider {#contentspider}++`ContentSpider`๋ **CrawlSpider**๋ฅผ ๋ฐํ์ผ๋ก ์ฌ์ดํธ๋ฅผ ๋ฐฉ๋ฌธํ๊ณ ๊ฐ ํ์ด์ง๋ฅผ LLM์ ์ ๋ฌํ๊ธฐ ์ข์ ์ ๋ฆฌ๋ Markdown์ผ๋ก ๋ฐ๊ฟ๋๋ค. ํ์ด์ง๋ง๋ค ํญ๋ชฉ ํ๋๋ฅผ ๋ด๋ณด๋ด๋ฉฐ, ํ์ํ๋ฉด Markdown ํ์ผ๋ ํ๋์ฉ ์์ฑํฉ๋๋ค.++```python+from scrapling.spiders import ContentSpider++class DocsSpider(ContentSpider):+ name = "docs"+ start_urls = ["https://example.com/docs/"]+ allowed_domains = {"example.com"}+ output_dir = "docs_markdown"++result = DocsSpider().start()+```++ํฌ๋กค๋ง ๋ฒ์๋ฅผ ๋์ ์ฌ์ดํธ๋ก ์ ํํ๋๋ก `allowed_domains`๋ฅผ ์ค์ ํด์ผ ํฉ๋๋ค. ์ ์ฒด ์ต์ ๊ณผ RAG ํ์ดํ๋ผ์ธ์ ๊ฒฐ๊ณผ๋ฅผ ์ ๋ฌํ๋ ๋ฐฉ๋ฒ์ [RAG ์์คํ ๋ง๋ค๊ธฐ](../ai/building-rag-systems.md)๋ฅผ ์ฐธ๊ณ ํ์ธ์.++## `LinkExtractor` ์ง์ ์ฌ์ฉํ๊ธฐ {#using-linkextractor-directly}++ํ ํ๋ฆฟ์ ํ์๊ฐ ์๋๋๋ค. `LinkExtractor`๋ ์ผ๋ฐ `Spider` ์์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.++```python+from scrapling.spiders import Spider, LinkExtractor++class CustomSpider(Spider):+ name = "custom"+ start_urls = ["https://example.com"]++ def __init__(self):+ super().__init__()+ self._links = LinkExtractor(allow=r"/posts/", deny_domains="ads.example.com")++ async def parse(self, response):+ for url in self._links.extract(response):+ yield response.follow(url, callback=self.parse_post)++ async def parse_post(self, response):+ yield {"title": response.css("h1::text").get()}+```++## LinkExtractor ์ฐธ๊ณ ์๋ฃ {#linkextractor-reference}++| ์ธ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|-------------------|----------------------|---------------------------------------------------------------------------------------------------|+| `allow` | `()` | ์ ์งํ URL ํจํด์ ๋๋ค. ๋น์ด ์์ผ๋ฉด ๋ชจ๋ ํ์ฉํฉ๋๋ค. ๋ฌธ์์ด, ์ปดํ์ผํ `Pattern`, ๋๋ ์ด ๊ฐ์ ๋ด์ ๋ฐ๋ณต ๊ฐ๋ฅํ ๊ฐ์ฒด๋ฅผ ๋ฐ์ต๋๋ค |+| `deny` | `()` | ์ ์ธํ URL ํจํด์ ๋๋ค. ํญ์ `allow`๋ณด๋ค ์ฐ์ ํฉ๋๋ค |+| `allow_domains` | `()` | ํ์ฉํ ํธ์คํธ ์ด๋ฆ์ ๋๋ค. ํ์ ๋๋ฉ์ธ๋ ํ์ฉํ๋ฏ๋ก `example.com`์ `api.example.com`๊ณผ๋ ์ผ์นํฉ๋๋ค |+| `deny_domains` | `()` | ์ ์ธํ ํธ์คํธ ์ด๋ฆ |+| `restrict_css` | `()` | DOM์์ ๋งํฌ๋ฅผ ์ถ์ถํ ์์ญ์ ์ ํํ๋ CSS ์ ํ์ |+| `restrict_xpath` | `()` | DOM์์ ๋งํฌ๋ฅผ ์ถ์ถํ ์์ญ์ ์ ํํ๋ XPath ์ ํ์ |+| `tags` | `("a", "area")` | ๋งํฌ๋ฅผ ์ฐพ์ ์์ ํ๊ทธ |+| `attrs` | `("href",)` | ํด๋น ํ๊ทธ์์ URL์ ์ฝ์ ์์ฑ |+| `canonicalize` | `True` | ์ฟผ๋ฆฌ ์ธ์๋ฅผ ์ ๋ ฌํ๊ณ ๊ฒฝ๋ก๋ฅผ ์ ๊ทํํฉ๋๋ค |+| `strip` | `True` | ์ถ์ถํ URL ์ ๋์ ๊ณต๋ฐฑ์ ์ ๊ฑฐํฉ๋๋ค |+| `keep_fragment` | `False` | ์ ๊ทํํ ๋ `#fragment`๋ฅผ ์ ์งํฉ๋๋ค |+| `deny_extensions` | `IGNORED_EXTENSIONS` | ์ ์ธํ ํ์ผ ํ์ฅ์์ ๋๋ค. pdf, zip, ์ด๋ฏธ์ง, ๋์์ ๋ฑ์ด ํด๋นํฉ๋๋ค |+| `process` | `None` | ํํฐ๋ง ์ ์ ์ถ์ถํ URL๋ง๋ค ์ ์ฉํ ์ ํ์ ํธ์ถ ๊ฐ๋ฅ ๊ฐ์ฒด์ ๋๋ค. ๊ฑฐ์ง์ผ๋ก ํ๊ฐ๋๋ ๊ฐ์ ๋ฐํํ๋ฉด URL์ ์ ์ธํฉ๋๋ค |++`LinkExtractor.extract(response)`๋ ํํฐ๋ง๊ณผ ์ค๋ณต ์ ๊ฑฐ๋ฅผ ๋ง์น ์ ๋ URL์ `list[str]`๋ฅผ ๋ฐํํฉ๋๋ค.++`LinkExtractor.matches(url)`์ `bool`์ ๋ฐํํ๋ URL ์ ์ฉ ํํฐ์ ๋๋ค. ํ์ฉ/์ ์ธ ํจํด, ๋๋ฉ์ธ, ํ์ฅ์๋ฅผ ๊ฒ์ฌํฉ๋๋ค. `SitemapSpider`๋ ์ด ๋ฉ์๋๋ก `Response` ์์ด URL์ ์ ๋ฌํ ๊ท์น์ ์ ํฉ๋๋ค.diff --git a/docs/locales/ko/spiders/getting-started.md b/docs/locales/ko/spiders/getting-started.mdnew file mode 100644index 0000000..0db4b4e--- /dev/null+++ b/docs/locales/ko/spiders/getting-started.md@@ -0,0 +1,199 @@+---+title: "Scrapling์ผ๋ก ์ฒซ Python ์น ํฌ๋กค๋ฌ ๋ง๋ค๊ธฐ"+description: "๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๊ณ ๋ค์ ํ์ด์ง๋ฅผ ๋ฐฉ๋ฌธํ๋ฉฐ ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ณด๋ด๋ ์คํ์ด๋๋ฅผ ๋ง๋์ธ์. ์์ URL, ์ฝ๋ฐฑ, ๋๋ฉ์ธ ์ ํ, robots.txt ์ค์ ์ ์์๋ด ๋๋ค."+---++# ์์ํ๊ธฐ {#getting-started}++## ์๊ฐ {#introduction}++!!! success "์์ ์ ํ์ธ"++ 1. [Fetcher ๊ธฐ๋ณธ ์ฌํญ](../fetching/choosing.md)์ ์ฝ๊ณ Fetcher ์ข ๋ฅ์ ๊ฐ๊ฐ์ ์ฉ๋๋ฅผ ์ดํดํด์ผ ํฉ๋๋ค.+ 2. [์ฃผ์ ํด๋์ค](../parsing/main_classes.md)๋ฅผ ์ฝ๊ณ [Selector](../parsing/main_classes.md#selector)์ [Response](../fetching/choosing.md#response-object) ํด๋์ค๋ฅผ ์ดํดํด์ผ ํฉ๋๋ค.+ 3. [์ํคํ ์ฒ](architecture.md)๋ฅผ ์ฝ๊ณ ์คํ์ด๋ ์์คํ ์ ์ ์ฒด ๋์์ ์์๋์ธ์.++์คํ์ด๋ ์์คํ ์ ์ฌ์ฉํ๋ฉด ์งง์ ์ฝ๋๋ก ์ฌ๋ฌ ํ์ด์ง๋ฅผ ๋์์ ์์งํ๋ ํฌ๋กค๋ฌ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค. Scrapy๋ฅผ ์ฌ์ฉํด ๋ดค๋ค๋ฉด ์ต์ํ ๋ฐฉ์์ ๋๋ค. ์ฒ์์ด๋ผ๋ ์ด ์๋ด์ ๋ฐ๋ผ ์์ํ ์ ์์ต๋๋ค.++## ์ฒซ ์คํ์ด๋ ๋ง๋ค๊ธฐ {#your-first-spider}++์คํ์ด๋๋ ์น์ฌ์ดํธ๋ฅผ ํ์ํ๊ณ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ์ ์ํ๋ ํด๋์ค์ ๋๋ค. ๊ฐ์ฅ ๊ฐ๋จํ ์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++```python+from scrapling.spiders import Spider, Response++class QuotesSpider(Spider):+ name = "quotes"+ start_urls = ["https://quotes.toscrape.com"]++ async def parse(self, response: Response):+ for quote in response.css("div.quote"):+ yield {+ "text": quote.css("span.text::text").get(""),+ "author": quote.css("small.author::text").get(""),+ }+```++๋ชจ๋ ์คํ์ด๋์๋ ๋ค์ ์ธ ๊ฐ์ง๊ฐ ํ์ํฉ๋๋ค.++1. **`name`**: ์คํ์ด๋์ ๊ณ ์ ํ ์ด๋ฆ์ ๋๋ค.+2. **`start_urls`**: ํฌ๋กค๋ง์ ์์ํ URL ๋ชฉ๋ก์ ๋๋ค.+3. **`parse()`**: ๊ฐ ์๋ต์ ์ฒ๋ฆฌํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ณด๋ด๋ ๋น๋๊ธฐ ์ ๋๋ ์ดํฐ ๋ฉ์๋์ ๋๋ค.++์ฃผ์ ์ฒ๋ฆฌ๋ `parse()`์์ ํฉ๋๋ค. Scrapling์ [Selector](../parsing/main_classes.md#selector)/[Response](../fetching/choosing.md#response-object)์ ๊ฐ์ ์ ํ ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๊ณ , ๋์ ๋๋ฆฌ๋ฅผ `yield`๋ก ๋ด๋ณด๋ด ์์งํ ํญ๋ชฉ์ ์ ๋ฌํฉ๋๋ค.++## ์คํ์ด๋ ์คํํ๊ธฐ {#running-the-spider}++์คํ์ด๋ ์ธ์คํด์ค๋ฅผ ๋ง๋ค๊ณ `start()`๋ฅผ ํธ์ถํ์ธ์.++```python+result = QuotesSpider().start()+```++`start()`๊ฐ ๋น๋๊ธฐ ์คํ์ ๋ด๋ถ์์ ์ฒ๋ฆฌํ๋ฏ๋ก ์ด๋ฒคํธ ๋ฃจํ๋ฅผ ์ง์ ๊ด๋ฆฌํ ํ์๊ฐ ์์ต๋๋ค. ์คํ ์ค์๋ ๋ชจ๋ ๋์์ด ํฐ๋ฏธ๋์ ๊ธฐ๋ก๋๊ณ , ํฌ๋กค๋ง์ด ๋๋๋ฉด ์์ธํ ํต๊ณ๋ฅผ ์ป์ต๋๋ค.++ํต๊ณ์ ๊ฒฐ๊ณผ๋ ๋ฐํ๋ `CrawlResult` ๊ฐ์ฒด์์ ํ์ธํ ์ ์์ต๋๋ค.++```python+result = QuotesSpider().start()++# Access scraped items+for item in result.items:+ print(item["text"], "-", item["author"])++# Check statistics+print(f"Scraped {result.stats.items_scraped} items")+print(f"Made {result.stats.requests_count} requests")+print(f"Took {result.stats.elapsed_seconds:.1f} seconds")++# Did the crawl finish or was it paused?+print(f"Completed: {result.completed}")+```++## ๋งํฌ ๋ฐ๋ผ๊ฐ๊ธฐ {#following-links}++๋๋ถ๋ถ์ ํฌ๋กค๋ง์ ๋งํฌ๋ฅผ ๋ฐ๋ผ ์ฌ๋ฌ ํ์ด์ง๋ฅผ ๋ฐฉ๋ฌธํฉ๋๋ค. `response.follow()`๋ก ๋ค์ ์์ฒญ์ ๋ง๋์ธ์.++```python+from scrapling.spiders import Spider, Response++class QuotesSpider(Spider):+ name = "quotes"+ start_urls = ["https://quotes.toscrape.com"]++ async def parse(self, response: Response):+ # Extract items from the current page+ for quote in response.css("div.quote"):+ yield {+ "text": quote.css("span.text::text").get(""),+ "author": quote.css("small.author::text").get(""),+ }++ # Follow the "next page" link+ next_page = response.css("li.next a::attr(href)").get()+ if next_page:+ yield response.follow(next_page, callback=self.parse)+```++`response.follow()`๋ ์๋ URL์ ํ์ฌ ํ์ด์ง์ URL๊ณผ ์๋์ผ๋ก ๊ฒฐํฉํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ํ์ฌ ํ์ด์ง๋ฅผ `Referer` ํค๋์๋ ์ค์ ํฉ๋๋ค.++ํ์ด์ง ์ข ๋ฅ์ ๋ฐ๋ผ ๋ค๋ฅธ ์ฝ๋ฐฑ ๋ฉ์๋๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค.++```python+async def parse(self, response: Response):+ for link in response.css("a.product-link::attr(href)").getall():+ yield response.follow(link, callback=self.parse_product)++async def parse_product(self, response: Response):+ yield {+ "name": response.css("h1::text").get(""),+ "price": response.css(".price::text").get(""),+ }+```++!!! note++ ๋ชจ๋ ์ฝ๋ฐฑ ๋ฉ์๋๋ `async def`์ `yield`๋ฅผ ์ฌ์ฉํ๋ ๋น๋๊ธฐ ์ ๋๋ ์ดํฐ์ฌ์ผ ํฉ๋๋ค.++## ๋ฐ์ดํฐ ๋ด๋ณด๋ด๊ธฐ {#exporting-data}++`result.items`์ `ItemList`์๋ ๋ด๋ณด๋ด๊ธฐ ๋ฉ์๋๊ฐ ์์ต๋๋ค.++```python+result = QuotesSpider().start()++# Export as JSON+result.items.to_json("quotes.json")++# Export as JSON with pretty-printing+result.items.to_json("quotes.json", indent=True)++# Export as JSON Lines (one JSON object per line)+result.items.to_jsonl("quotes.jsonl")++# Export as CSV or XML+result.items.to_csv("quotes.csv")+result.items.to_xml("quotes.xml")+```++๋ชจ๋ ๋ฉ์๋๋ ์์ ๋๋ ํฐ๋ฆฌ๊ฐ ์์ผ๋ฉด ์๋์ผ๋ก ๋ง๋ญ๋๋ค.++`to_csv()`๋ ์ ์ฒด ํญ๋ชฉ์์ ๋ฐ๊ฒฌํ ๋ชจ๋ ํค๋ฅผ ์ด๋ก ๋ง๋ญ๋๋ค. ํญ๋ชฉ๋ง๋ค ํค๊ฐ ๋ฌ๋ผ๋ ๋ด๋ณด๋ผ ์ ์์ผ๋ฉฐ, ๊ฐ์ด ์๋ ์ ์ ๋น์ ๋ก๋๋ค. ์ด๊ณผ ์์๋ฅผ ์ง์ ์ ํํ๋ ค๋ฉด `fields=[...]`๋ฅผ, TSV ํ์ผ์ ๋ง๋ค๋ ค๋ฉด `delimiter="\t"`๋ฅผ ์ ๋ฌํ์ธ์. `to_xml()`์ ๊ฐ ํญ๋ชฉ์ `<item>` ์์๋ก ๊ฐ์ธ๊ณ `<items>` ๋ฃจํธ ์์ ๋ฃ์ต๋๋ค. ๋ ์ด๋ฆ์ `root_tag`์ `item_tag`๋ก ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.++๋ ํ์ ๋ชจ๋ ์ค์ฒฉ ๋์ ๋๋ฆฌ๋ ๋ฆฌ์คํธ์ฒ๋ผ ๋จ์ํ ์ค์นผ๋ผ๊ฐ ์๋ ๊ฐ์ JSON์ผ๋ก ๊ธฐ๋กํฉ๋๋ค. ๋ฐ์ดํฐ๊ฐ ์๋ฆผ ์์ด ์ฌ๋ผ์ง์ง ์์ต๋๋ค.++## ๋๋ฉ์ธ ์ ํํ๊ธฐ {#filtering-domains}++`allowed_domains`๋ก ๋ฐฉ๋ฌธํ ๋๋ฉ์ธ์ ์ ํํ์ธ์. ์ธ๋ถ ์น์ฌ์ดํธ์ ๋งํฌ๋ฅผ ์ค์๋ก ๋ฐ๋ผ๊ฐ๋ ์ผ์ ๋ง์ ์ ์์ต๋๋ค.++```python+class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]+ allowed_domains = {"example.com"}++ async def parse(self, response: Response):+ for link in response.css("a::attr(href)").getall():+ # Links to other domains are silently dropped+ yield response.follow(link, callback=self.parse)+```++ํ์ ๋๋ฉ์ธ๋ ์๋์ผ๋ก ํ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ด `allowed_domains = {"example.com"}`์ `sub.example.com`, `blog.example.com` ๋ฑ๋ ํ์ฉํฉ๋๋ค.++์ ์ธํ ์์ฒญ ์๋ `stats.offsite_requests_count`์์ ํ์ธํ ์ ์์ต๋๋ค.++## robots.txt ์ค์ํ๊ธฐ {#robotstxt-compliance}++`robots_txt_obey = True`๋ฅผ ์ค์ ํ๋ฉด ๊ฐ ๋๋ฉ์ธ์ ํฌ๋กค๋งํ๊ธฐ ์ ์ robots.txt ๊ท์น์ ํ์ธํฉ๋๋ค.++```python+class PoliteSpider(Spider):+ name = "polite"+ start_urls = ["https://example.com"]+ robots_txt_obey = True++ async def parse(self, response: Response):+ for link in response.css("a::attr(href)").getall():+ yield response.follow(link, callback=self.parse)+```++ํ์ฑํํ๋ฉด ๋ค์๊ณผ ๊ฐ์ด ๋์ํฉ๋๋ค.++1. ํฌ๋กค๋ง ์ ์ `start_urls`์ ๋ชจ๋ ๋๋ฉ์ธ์์ **robots.txt๋ฅผ ๋ฏธ๋ฆฌ ๊ฐ์ ธ์ต๋๋ค**. ์ฌ๋ฌ ๋๋ฉ์ธ์ ๋์์ ์ฒ๋ฆฌํฉ๋๋ค.+2. **๋ชจ๋ ์์ฒญ์ ํ์ธ**ํ์ฌ ๋๋ฉ์ธ์ robots.txt `Disallow` ๊ท์น์ ์ ์ฉํฉ๋๋ค. ๊ธ์ง๋ ์์ฒญ์ ์๋ฆผ ์์ด ์ ์ธํ๊ณ `stats.robots_disallowed_count`์ ์ง๊ณํฉ๋๋ค.+3. **`Crawl-delay`์ `Request-rate` ์ง์๋ฌธ์ ์ค์**ํฉ๋๋ค. ์ง์๋ฌธ์ด ์๊ตฌํ๋ ์ง์ฐ๊ณผ ์ค์ ํ `download_delay` ์ค ํฐ ๊ฐ์ ์ฌ์ฉํฉ๋๋ค. ๋ฐ๋ผ์ robots.txt๋ ์ค์ ํ ์ง์ฐ์ ์ค์ด์ง ์๊ณ ํ์ํ ๋๋ง ๋๋ฆฝ๋๋ค. AutoThrottle์ด ํ์ฑํ๋์ด ์์ผ๋ฉด ์ต๋ ์ง์ฐ ์ค์ ๋ ์ ์ฉ๋ฉ๋๋ค. ํ์ํ ์ง์ฐ์ ์งํฌ ์ ์๋๋ก `autothrottle_max_delay`๋ฅผ ์ถฉ๋ถํ ํฌ๊ฒ ์ค์ ํ์ธ์.++robots.txt ํ์ผ์ ๊ธฐ๋ณธ ์ธ์ ์ผ๋ก ๊ฐ์ ธ์ค๋ฉฐ, ํฌ๋กค๋ง์ด ๋๋ ๋๊น์ง ๋๋ฉ์ธ๋ณ๋ก ์บ์ํฉ๋๋ค. ํฌ๋กค๋ง ์ค ๋ฐ๊ฒฌํ ๋๋ฉ์ธ์ด `start_urls`์ ์๋ค๋ฉด ํด๋น ๋๋ฉ์ธ์ ์ฒ์ ์์ฒญํ ๋ robots.txt๋ฅผ ๊ฐ์ ธ์ต๋๋ค.++**์ฐธ๊ณ :** ์์์น ๋ชปํ ๋์์ ํผํ๊ธฐ ์ํด `robots_txt_obey`๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค. ํ์ฑํํด๋ ๋์ ์์ฒญ ์ค์ ์ธ `concurrent_requests`, `concurrent_requests_per_domain`์ ๋ฐ๋์ง ์์ต๋๋ค. ์์ฒญ ์ฌ์ด์ ์ง์ฐ๋ง ์กฐ์ ํฉ๋๋ค.++`download_delay`๋ฅผ ์ง์ ์ ํ๊ณ ์ถ์ง ์๋ค๋ฉด `autothrottle_enabled = True`๋ฅผ ์ค์ ํ์ธ์. ์คํ์ด๋๊ฐ ๊ฐ ๋๋ฉ์ธ์ ์๋ต ์๋์ ๋ง์ถฐ ์ง์ฐ์ ์กฐ์ ํ๊ณ , ์ฐจ๋จ๋๋ฉด ์๋๋ฅผ ์ค์ ๋๋ค. [AutoThrottle](advanced.md#autothrottle)์ ์ฐธ๊ณ ํ์ธ์.++## ๋ค์ ๋จ๊ณ {#whats-next}++๊ธฐ๋ณธ ์ฌํญ์ ์ตํ๋ค๋ฉด ๋ค์ ๋ด์ฉ์ ์ดํด๋ณด์ธ์.++- [์์ฒญ๊ณผ ์๋ต](requests-responses.md): ์์ฒญ ์ฐ์ ์์, ์ค๋ณต ์ ๊ฑฐ, ๋ฉํ๋ฐ์ดํฐ ๋ฑ์ ์์๋ด ๋๋ค.+- [์ธ์ ](sessions.md): ํ ์คํ์ด๋์์ HTTP, ๋ธ๋ผ์ฐ์ , ์คํ ์ค ๋ฑ ์ฌ๋ฌ Fetcher ์ข ๋ฅ๋ฅผ ์ฌ์ฉํฉ๋๋ค.+- [ํ๋ก์์ ์ฐจ๋จ ์ฒ๋ฆฌ](proxy-blocking.md): ์์ฒญ๋ง๋ค ํ๋ก์๋ฅผ ๋ฐ๊พธ๊ณ ์ฐจ๋จ์ ์ฒ๋ฆฌํฉ๋๋ค.+- [๊ณ ๊ธ ๊ธฐ๋ฅ](advanced.md): ๋์ ์์ฒญ ์ ์ด, AutoThrottle, ์ผ์ ์ค์ง์ ์ฌ๊ฐ, ์คํธ๋ฆฌ๋ฐ, ์๋ช ์ฃผ๊ธฐ ํ , ๋ก๊น ์ ์์๋ด ๋๋ค.diff --git a/docs/locales/ko/spiders/platform-templates.md b/docs/locales/ko/spiders/platform-templates.mdnew file mode 100644index 0000000..6d4409d--- /dev/null+++ b/docs/locales/ko/spiders/platform-templates.md@@ -0,0 +1,59 @@+---+title: "Python์ผ๋ก Shopify ์ํ ๋ฐ์ดํฐ ์์งํ๊ธฐ"+description: "ShopifySpider๋ก Shopify ์คํ ์ด์ ์ํ ๋ชฉ๋ก์ ์์งํ์ธ์. ์คํ ์ด URL์ ์ค์ ํ๊ณ ์ํ ์ต์ ์กฐํฉ๋ณ ๋ฐ์ดํฐ๋ฅผ ๋ชจ์ผ๋ฉฐ ๊ฐ ํญ๋ชฉ์ ํ๋๋ฅผ ํ์ธํฉ๋๋ค."+---++# ํ๋ซํผ๋ณ ์คํ์ด๋ ํ ํ๋ฆฟ {#platform-spider-templates}++์ผ๋ฐ ํ ํ๋ฆฟ์ ๋งํฌ ๋ฐ๋ผ๊ฐ๊ธฐ๋ ์ฌ์ดํธ๋งต ๋ฐฉ๋ฌธ ๊ฐ์ ํฌ๋กค๋ง *๋ฐฉ์*์ ๋ค๋ฃน๋๋ค. ํ๋ซํผ ํ ํ๋ฆฟ์ *ํ๋ซํผ*์ ๋ค๋ฃน๋๋ค. ์ฌ๋ฌ ๋ ๋ฆฝ๋ ์ฌ์ดํธ์์ ๊ฐ์ ๊ธฐ๊ณ ํ๋ ์ฉ ๊ตฌ์กฐ๋ฅผ ์ ๊ณตํ๋ ์ฌ์ดํธ ์ ์ ํ๋ซํผ์ด ๋์์ ๋๋ค. ์คํ์ด๋๊ฐ ๋ฐ์ดํฐ ์์น๋ฅผ ์ด๋ฏธ ์๊ณ ์์ผ๋ฏ๋ก ๋๋ฉ์ธ๋ง ์ง์ ํ๋ฉด ๋ฉ๋๋ค.++## ShopifySpider {#shopifyspider}++`ShopifySpider`๋ Shopify์ JSON API๋ก ์คํ ์ด์ ๋ชจ๋ ์ํ์ ์ถ์ถํฉ๋๋ค. ์น์ฌ์ดํธ์ HTML์ ์ฌ์ฉํ์ง ์์ต๋๋ค.++```python+from scrapling.spiders import ShopifySpider++class MyStore(ShopifySpider):+ target_website = "example.com"++result = MyStore().start()+print(result.items[0])+```++`target_website`์ ์คํ ์ด ๋๋ฉ์ธ์ ์ค์ ํ์ธ์. ๋น์ด ์์ผ๋ฉด `start_urls`์ ์ฒซ ํญ๋ชฉ, ๋ค์์ผ๋ก `allowed_domains`๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ ๋ค ๋น์ด ์์ผ๋ฉด `ValueError`๊ฐ ๋ฐ์ํฉ๋๋ค. ์ ์ฒด URL์ ์ ๋ฌํ๋ฉด ์๋์ผ๋ก ๋๋ฉ์ธ์ผ๋ก ๋ณํํฉ๋๋ค.++### ๋์ ๋ฐฉ์ {#how-it-works}++1. `https://<store>/collections.json`์ ํ์ด์ง๋ฅผ ์์๋๋ก ๊ฐ์ ธ์ต๋๋ค. ํ์ด์ง๋น ์ปฌ๋ ์ ์ ํ๋ซํผ ์ ํ์ธ 250๊ฐ์ ๋๋ค.+2. ์ํ์ด ์๋ค๊ณ ํ์๋ ๊ฐ ์ปฌ๋ ์ ์์ `/collections/<handle>/products.json`์ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ต๋๋ค.+3. ์ํ ์ต์ ์กฐํฉ๋ณ๋ก ํญ๋ชฉ ํ๋๋ฅผ ๋ด๋ณด๋ ๋๋ค. ์ฌ๋ฌ ์ปฌ๋ ์ ์ ๋ํ๋๋ ๊ฐ์ ์ต์ ์กฐํฉ์ ์ค๋ณต ์ ๊ฑฐํฉ๋๋ค.++### ํญ๋ชฉ ํ๋ {#item-fields}++| ํ๋ | ์ถ์ฒ |+|---------------|---------------------------------------------------------------------------|+| `name` | ์ํ ์ด๋ฆ๊ณผ ์ต์ ์ด๋ฆ์ ๋๋ค. ๊ธฐ๋ณธ ์ต์ ์ด๋ฉด ์ต์ ์ด๋ฆ์ ๋ฃ์ง ์์ต๋๋ค |+| `price` | Shopify๊ฐ ๋ฐํํ ๊ทธ๋๋ก์ ์ต์ ๊ฐ๊ฒฉ ๋ฌธ์์ด |+| `category` | ์ปฌ๋ ์ URL์ ์ด๋ฆ ๋ถ๋ถ์์ ๊ฐ ๋จ์ด์ ์ฒซ ๊ธ์๋ฅผ ๋๋ฌธ์๋ก ๋ฐ๊ฟ๋๋ค. `summer-sale`์ `Summer Sale`์ด ๋ฉ๋๋ค |+| `brand` | ์ํ ๊ณต๊ธ์ ์ฒด |+| `identifier` | ์ต์ ID |+| `sku` | ์ต์ SKU์ ๋๋ค. ์คํ ์ด์์ ์ค์ ํ์ง ์์ผ๋ฉด `""`์ ๋๋ค |+| `stock` | ์ต์ ์ ๊ตฌ๋งคํ ์ ์์ผ๋ฉด `None`, ํ์ ์ด๋ฉด `0` |+| `image_url` | ์ฒซ ์ํ ์ด๋ฏธ์ง ๋๋ `""` |+| `url` | ์ปฌ๋ ์ ์์ ์ํ ํ์ด์ง |+| `description` | HTML ํ๊ทธ๋ฅผ ์ ๊ฑฐํ ์ํ์ `body_html` |+| `old_price` | ์ค์ ํ ์ธ ์ ๊ฐ๊ฒฉ์ด๋ฉด `compare_at_price`, ์๋๋ฉด `""` |+| `barcode` | ์ต์ ๋ฐ์ฝ๋ ๋๋ `""`์ ๋๋ค. ๋๋ถ๋ถ์ ์คํ ์ด๋ ์ด API์์ ๋ฐ์ฝ๋๋ฅผ ์ ๊ณตํ์ง ์์ต๋๋ค |++์ด ํ๋ ๊ตฌ์ฑ์ด ํ์๋ ์๋๋๋ค. ํ์ ํด๋์ค์์ `_process_product()`๋ฅผ ์ฌ์ ์ํ๋ฉด ํญ๋ชฉ ๊ตฌ์กฐ๋ฅผ ๋ฐ๊พธ๊ฑฐ๋ ๋ค๋ฅธ ์ํ ํ๋๋ฅผ ์ถ์ถํ ์ ์์ต๋๋ค.++### ์ฐธ๊ณ ์ฌํญ๊ณผ ์ ํ {#notes-and-limits}++- JSON API๋ ์จ๋ผ์ธ ์คํ ์ด ์ฑ๋์ ๊ฒ์๋ ์ํ๋ง ์ ๊ณตํฉ๋๋ค. ๋ฐ๋ผ์ ์ปฌ๋ ์ ์ `products_count`๊ฐ ์ค์ ๋ก ๊ฐ์ ธ์ฌ ์ ์๋ ์๋ณด๋ค ํด ์ ์์ต๋๋ค. ์คํ์ด๋๋ ์ด ๊ฐ์ ์์ ์ด๊ฐ์๋ก ์ฌ์ฉํ์ง ์๊ณ , 0์ด ์๋๋ฉด ์ปฌ๋ ์ ์ ๊ฐ์ ธ์ค๋ ์กฐ๊ฑด์ผ๋ก๋ง ์ฌ์ฉํฉ๋๋ค.+- ์ถ๊ฐ ๋ณดํธ ๊ธฐ๋ฅ์ด๋ ๋น๋ฐ๋ฒํธ๊ฐ ์๋ ์คํ ์ด์์๋ ์ด ํ ํ๋ฆฟ์ด ์๋ํ์ง ์์ ๊ฐ๋ฅ์ฑ์ด ํฝ๋๋ค. ์๋ํ๊ฒ ๋ง๋ค ์ ์๋๋ผ๋ ์ฌ๋ฌ ๋ฉ์๋๋ฅผ ์ง์ ์ฌ์ ์ํด์ผ ํฉ๋๋ค.+- ๋์ ์์ฒญ ์ค์ , ์ง์ฐ, robots.txt ์ค์, ์ฒดํฌํฌ์ธํธ, ์๋ช ์ฃผ๊ธฐ ํ ๋ฑ `Spider`์ ๊ธฐ๋ฅ์ ๊ทธ๋๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.++### ํ๋ซํผ ํ ํ๋ฆฟ์ผ๋ก ์ธ์ ๋๋ ๋ฒ์ {#what-qualifies-as-a-platform-template}++Shopify์ฒ๋ผ ์ฌ๋ฌ ๋ ๋ฆฝ๋ ์น์ฌ์ดํธ์์ ๊ฐ์ ๊ธฐ๊ณ ํ๋ ์ฉ ๊ตฌ์กฐ๋ฅผ ์ ๊ณตํ๋ ํ๋ซํผ์ ํ ํ๋ฆฟ์ ๋ฐ์ต๋๋ค. ์๋ฌด๋ฆฌ ์ธ๊ธฐ ์๋ ์ฌ์ดํธ๋ผ๋ ํน์ ์ฌ์ดํธ ํ๋๋ง์ ์ํ ์คํ์ด๋๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํฌํจํ์ง ์์ต๋๋ค.diff --git a/docs/locales/ko/spiders/proxy-blocking.md b/docs/locales/ko/spiders/proxy-blocking.mdnew file mode 100644index 0000000..13f3755--- /dev/null+++ b/docs/locales/ko/spiders/proxy-blocking.md@@ -0,0 +1,249 @@+---+title: "ํ๋ก์ ์ํ๊ณผ ์ฐจ๋จ๋ ํฌ๋กค๋ง ์์ฒญ ์ฌ์๋"+description: "Scrapling ์คํ์ด๋์์ ํ๋ก์์ ์ํ ๋ฐฉ์์ ์ฌ์ฉํ์ธ์. ์ฐจ๋จ๋ ์๋ต์ ๊ฐ์งํ๊ณ ์์ฒญ์ ์ฌ์๋ํ๋ฉฐ HTTP์์ ๋ธ๋ผ์ฐ์ ์ธ์ ์ผ๋ก ์ ํํฉ๋๋ค."+---++# ํ๋ก์ ๊ด๋ฆฌ์ ์ฐจ๋จ ์ฒ๋ฆฌ {#proxy-management-and-handling-blocks}++## ์๊ฐ {#introduction}++!!! success "์์ ์ ํ์ธ"++ 1. [์์ํ๊ธฐ](getting-started.md)๋ฅผ ์ฝ๊ณ ๊ฐ๋จํ ์คํ์ด๋๋ฅผ ๋ง๋ค๊ณ ์คํํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 2. [์ธ์ ](sessions.md)์ ์ฝ๊ณ ์ธ์ ์ค์ ๋ฐฉ๋ฒ์ ์ดํดํด์ผ ํฉ๋๋ค.++๋ง์ ๋ฐ์ดํฐ๋ฅผ ์์งํ ๋๋ ์์ฒญ ๋น๋ ์ ํ์ด๋ ์ฐจ๋จ์ ํผํ๊ธฐ ์ํด ์ฌ๋ฌ ํ๋ก์๋ฅผ ๋ฒ๊ฐ์ ์จ์ผ ํ ์ ์์ต๋๋ค. Scrapling์ `ProxyRotator`๋ก ๊ฐ๋จํ๊ฒ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค. ๋ชจ๋ ์ธ์ ์ข ๋ฅ์ ํจ๊ป ์ฌ์ฉํ ์ ์๊ณ , ์คํ์ด๋์ ์ฐจ๋จ ์์ฒญ ์ฌ์๋ ๊ธฐ๋ฅ๊ณผ๋ ์ฐ๊ฒฐ๋ฉ๋๋ค.++ํ๋ก์๊ฐ ๋ฌด์์ธ์ง, ์ด๋ป๊ฒ ๊ณจ๋ผ์ผ ํ๋์ง ๋ชจ๋ฅธ๋ค๋ฉด [์ด ์๋ด](https://substack.thewebscraping.club/p/everything-about-proxies)๋ฅผ ์ฐธ๊ณ ํ์ธ์.++## ProxyRotator {#proxyrotator}++`ProxyRotator`๋ ํ๋ก์ ๋ชฉ๋ก์ ๊ด๋ฆฌํ๊ณ ์๋์ผ๋ก ์ํํฉ๋๋ค. ์ธ์ ์ `proxy_rotator` ์ธ์๋ก ์ ๋ฌํ์ธ์.++```python+from scrapling.spiders import Spider, Response+from scrapling.fetchers import FetcherSession, ProxyRotator++class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]++ def configure_sessions(self, manager):+ rotator = ProxyRotator([+ "http://proxy1:8080",+ "http://proxy2:8080",+ "http://user:pass@proxy3:8080",+ ])+ manager.add("default", FetcherSession(proxy_rotator=rotator))++ async def parse(self, response: Response):+ # Check which proxy was used+ print(f"Proxy used: {response.meta.get('proxy')}")+ yield {"title": response.css("title::text").get("")}+```++๊ฐ ์์ฒญ์ ์์์ ๋ฐ๋ผ ๋ค์ ํ๋ก์๋ฅผ ์๋์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ์ฌ์ฉํ ํ๋ก์๋ `response.meta["proxy"]`์ ์ ์ฅ๋๋ฏ๋ก ์ด๋ค ํ๋ก์๋ก ํ์ด์ง๋ฅผ ๊ฐ์ ธ์๋์ง ํ์ธํ ์ ์์ต๋๋ค.+++๋ธ๋ผ์ฐ์ ์ธ์ ์์๋ ๋ค์๊ณผ ๊ฐ์ด ์กฐ๊ธ ๋ค๋ฅด๊ฒ ์ค์ ํฉ๋๋ค.++```python+from scrapling.fetchers import AsyncStealthySession, ProxyRotator++# String proxies work for all session types+rotator = ProxyRotator([+ "http://proxy1:8080",+ "http://proxy2:8080",+])++# Dict proxies (Playwright format) work for browser sessions+rotator = ProxyRotator([+ {"server": "http://proxy1:8080", "username": "user", "password": "pass"},+ {"server": "http://proxy2:8080"},+])++# Then inside the spider+def configure_sessions(self, manager):+ rotator = ProxyRotator(["http://proxy1:8080", "http://proxy2:8080"])+ manager.add("browser", AsyncStealthySession(proxy_rotator=rotator))+```++!!! info++ 1. ํ ์ธ์ ์์ `proxy_rotator`๋ฅผ ๊ณ ์ `proxy` ๋๋ `proxies` ์ธ์์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ธ์ ์ ์ค์ ํ ๋ ํ ๋ฐฉ์์ ์ ํํ์ธ์. ๋์ค์ ๊ฐ๋ณ ์์ฒญ์์ ํ๋ก์๋ฅผ ๋ฐ๊พธ๋ ๋ฐฉ๋ฒ์ ์๋์์ ์ค๋ช ํฉ๋๋ค.+ 2. ๊ธฐ๋ณธ์ ์ผ๋ก ๋ชจ๋ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ฌ๋ฌ ํญ์ ๊ด๋ฆฌํ๋ ํ๊ณผ ์๊ตฌ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค. ํ์ง๋ง ๋ธ๋ผ์ฐ์ ๋ ํญ๋ง๋ค ๋ค๋ฅธ ํ๋ก์๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ `ProxyRotator`๋ฅผ ์ฌ์ฉํ๋ฉด Fetcher๊ฐ ํ๋ก์๋ง๋ค ๋ณ๋์ ์ปจํ ์คํธ์ ํญ ํ๋๋ฅผ ๋ง๋ญ๋๋ค. ํญ์ ์์ ์ด ๋๋๋ฉด ํญ๊ณผ ์ปจํ ์คํธ๋ฅผ ๋ชจ๋ ๋ซ์ต๋๋ค.++## ํ๋ก์ ์ํ ๋ฐฉ์ ๋ฐ๊พธ๊ธฐ {#custom-rotation-strategies}++๊ธฐ๋ณธ์ ์ผ๋ก `ProxyRotator`๋ ํ๋ก์๋ฅผ ์์๋๋ก ์ฌ์ฉํ๊ณ , ๋ง์ง๋ง์ ๋๋ฌํ๋ฉด ์ฒ์๋ถํฐ ๋ค์ ์์ํฉ๋๋ค.++๋ค๋ฅธ ๋ฐฉ์์ด ํ์ํ๋ฉด ๋ค์ ์๊ทธ๋์ฒ๋ฅผ ๋ฐ๋ฅด๋ ํจ์๋ฅผ ์ ๋ฌํ์ธ์.++```python+from scrapling.core._types import ProxyType++def my_strategy(proxies: list, current_index: int) -> tuple[ProxyType, int]:+ ...+```++์ด ํจ์๋ ํ๋ก์ ๋ชฉ๋ก๊ณผ ํ์ฌ ์ธ๋ฑ์ค๋ฅผ ๋ฐ๊ณ , ์ ํํ ํ๋ก์์ ๋ค์ ์ธ๋ฑ์ค๋ฅผ ๋ฐํํด์ผ ํฉ๋๋ค.++๋ค์์ ์ฌ์ฉ์ ์ ์ ์ํ ๋ฐฉ์์ ์์ ๋๋ค.++### ๋ฌด์์ ์ ํ {#random-rotation}++```python+import random+from scrapling.fetchers import ProxyRotator++def random_strategy(proxies, current_index):+ idx = random.randint(0, len(proxies) - 1)+ return proxies[idx], idx++rotator = ProxyRotator(+ ["http://proxy1:8080", "http://proxy2:8080", "http://proxy3:8080"],+ strategy=random_strategy,+)+```++### ๊ฐ์ค์น์ ๋ฐ๋ฅธ ์ ํ {#weighted-rotation}++```python+import random++def weighted_strategy(proxies, current_index):+ # First proxy gets 60% of traffic, others split the rest+ weights = [60] + [40 // (len(proxies) - 1)] * (len(proxies) - 1)+ proxy = random.choices(proxies, weights=weights, k=1)[0]+ return proxy, current_index # Index doesn't matter for weighted++rotator = ProxyRotator(proxies, strategy=weighted_strategy)+```+++## ๊ฐ๋ณ ์์ฒญ์ ํ๋ก์ ๋ฐ๊พธ๊ธฐ {#per-request-proxy-override}++๊ฐ๋ณ ์์ฒญ์ `proxy=` ํค์๋ ์ธ์๋ฅผ ์ ๋ฌํ๋ฉด ์๋ ์ํ ๋์ ํด๋น ํ๋ก์๋ฅผ ์ฌ์ฉํฉ๋๋ค.++```python+async def parse(self, response: Response):+ # This request uses the rotator's next proxy+ yield response.follow("/page1", callback=self.parse_page)++ # This request uses a specific proxy, bypassing the rotator+ yield response.follow(+ "/special-page",+ callback=self.parse_page,+ proxy="http://special-proxy:8080",+ )+```++ํน์ ํ์ด์ง์ ์ง์ ๋ ํ๋ก์๊ฐ ํ์ํ ๋ ์ ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ด ์ง์ญ๋ณ ์ฝํ ์ธ ๋ฅผ ๊ฐ์ ธ์ฌ ๋ ํด๋น ์ง์ญ์ ํ๋ก์๋ฅผ ์ธ ์ ์์ต๋๋ค.++## ์ฐจ๋จ๋ ์์ฒญ ์ฒ๋ฆฌ {#blocked-request-handling}++์คํ์ด๋์๋ ์ฐจ๋จ ๊ฐ์ง์ ์ฌ์๋ ๊ธฐ๋ฅ์ด ์์ต๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก `401`, `403`, `407`, `429`, `444`, `500`, `502`, `503`, `504` HTTP ์ํ ์ฝ๋๋ฅผ ์ฐจ๋จ์ผ๋ก ๋ด ๋๋ค.++์ฌ์๋๋ ๋ค์ ์์๋ก ์งํํฉ๋๋ค.++1. ์๋ต์ ๋ฐ์ผ๋ฉด `is_blocked(response)`๋ฅผ ํธ์ถํฉ๋๋ค.+2. ์ฐจ๋จ๋ ๊ฒฝ์ฐ ์์ฒญ์ ๋ณต์ฌํ๊ณ `retry_blocked_request()`๋ฅผ ํธ์ถํฉ๋๋ค. ์ฌ๊ธฐ์ ์ฌ์๋ํ ์์ฒญ์ ์์ ํ ์ ์์ต๋๋ค.+3. ์์ฒญ์ `dont_filter=True`์ ๋ฎ์ ์ฐ์ ์์๋ก ํ์ ๋ค์ ๋ฃ์ต๋๋ค. ์ค๋ณต ์ ๊ฑฐ๋ฅผ ๊ฑด๋๋ฐ๊ณ ๋ฐ๋ก ์ฌ์๋ํ์ง ์๋๋ก ํฉ๋๋ค.+4. ์ต๋ `max_blocked_retries`๋ฒ ๋ฐ๋ณตํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 3์ ๋๋ค.++!!! tip++ 1. ์ฌ์๋ํ ๋ ๊ธฐ์กด `proxy`/`proxies` ์ธ์๋ฅผ ์์ฒญ์์ ์๋์ผ๋ก ์ง์๋๋ค. ๋ฐ๋ผ์ ์ํ ๊ธฐ๋ฅ์ด ์ ํ๋ก์๋ฅผ ์ ํํฉ๋๋ค.+ 2. `max_blocked_retries`๋ ์ธ์ ๋ด๋ถ์ ์ฌ์๋์ ๋ณ๊ฐ์ด๋ฉฐ ํ์๋ฅผ ๊ณต์ ํ์ง ์์ต๋๋ค.++### ์ฐจ๋จ ๊ฐ์ง ๋ฐ๊พธ๊ธฐ {#custom-block-detection}++`is_blocked()`๋ฅผ ์ฌ์ ์ํด ํ์ํ ๊ฐ์ง ๋ฐฉ์์ ์ถ๊ฐํ์ธ์.++```python+class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]++ async def is_blocked(self, response: Response) -> bool:+ # Check status codes (default behavior)+ if response.status in {403, 429, 503}:+ return True++ # Check response content+ body = response.body.decode("utf-8", errors="ignore")+ if "access denied" in body.lower() or "rate limit" in body.lower():+ return True++ return False++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```++### ์ฌ์๋ ๋์ ๋ฐ๊พธ๊ธฐ {#customizing-retries}++`retry_blocked_request()`๋ฅผ ์ฌ์ ์ํ๋ฉด ์ฌ์๋ ์ ์ ์์ฒญ์ ๋ฐ๊ฟ ์ ์์ต๋๋ค. `max_blocked_retries`๋ ์ฐจ๋จ๋ ์์ฒญ์ ์ฌ์๋ ํ์์ด๋ฉฐ ๊ธฐ๋ณธ๊ฐ์ 3์ ๋๋ค.++```python+from scrapling.spiders import Spider, SessionManager, Request, Response+from scrapling.fetchers import FetcherSession, AsyncStealthySession+++class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]+ max_blocked_retries = 5++ def configure_sessions(self, manager: SessionManager) -> None:+ manager.add('requests', FetcherSession(impersonate=['chrome', 'firefox', 'safari']))+ manager.add('stealth', AsyncStealthySession(block_webrtc=True), lazy=True)++ async def retry_blocked_request(self, request: Request, response: Response) -> Request:+ request.sid = "stealth"+ self.logger.info(f"Retrying blocked request: {request.url}")+ return request++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```++์ ์๋ ์ฐจ๋จ ๊ฐ์ง ๋ฐฉ์์ ๊ทธ๋๋ก ๋๊ณ HTTP ์์ฒญ์ ์ฌ์ฉํ๋ค๊ฐ ์ฐจ๋จ๋๋ฉด ์คํ ์ค ๋ธ๋ผ์ฐ์ ๋ก ์ ํํฉ๋๋ค.+++๋ชจ๋ ํฉ์น๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++```python+from scrapling.spiders import Spider, SessionManager, Request, Response+from scrapling.fetchers import FetcherSession, AsyncStealthySession, ProxyRotator+++cheap_proxies = ProxyRotator([ "http://proxy1:8080", "http://proxy2:8080"])++# A format acceptable by the browser+expensive_proxies = ProxyRotator([+ {"server": "http://residential_proxy1:8080", "username": "user", "password": "pass"},+ {"server": "http://residential_proxy2:8080", "username": "user", "password": "pass"},+ {"server": "http://mobile_proxy1:8080", "username": "user", "password": "pass"},+ {"server": "http://mobile_proxy2:8080", "username": "user", "password": "pass"},+])+++class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]+ max_blocked_retries = 5++ def configure_sessions(self, manager: SessionManager) -> None:+ manager.add('requests', FetcherSession(impersonate=['chrome', 'firefox', 'safari'], proxy_rotator=cheap_proxies))+ manager.add('stealth', AsyncStealthySession(block_webrtc=True, proxy_rotator=expensive_proxies), lazy=True)++ async def retry_blocked_request(self, request: Request, response: Response) -> Request:+ request.sid = "stealth"+ self.logger.info(f"Retrying blocked request: {request.url}")+ return request++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```+์ฒ์์๋ ๋ฐ์ดํฐ์ผํฐ ํ๋ก์์ฒ๋ผ ์ ๋ ดํ ํ๋ก์๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ฐจ๋จ๋๋ฉด ์ฃผ๊ฑฐ์ฉ์ด๋ ๋ชจ๋ฐ์ผ ํ๋ก์์ฒ๋ผ ํ์ง์ด ๋์ ํ๋ก์๋ก ์ฌ์๋ํฉ๋๋ค.diff --git a/docs/locales/ko/spiders/requests-responses.md b/docs/locales/ko/spiders/requests-responses.mdnew file mode 100644index 0000000..2e47066--- /dev/null+++ b/docs/locales/ko/spiders/requests-responses.md@@ -0,0 +1,207 @@+---+title: "์คํ์ด๋ ์์ฒญ, ์ฝ๋ฐฑ, Response.follow"+description: "ํฌ๋กค๋ง ์์ฒญ์ ๋ง๋ค๊ณ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌํ๋ฉฐ response.follow๋ก ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ์ธ์. ์ฝ๋ฐฑ, ์ฐ์ ์์, ์์ฒญ ์ค๋ณต ์ ๊ฑฐ๋ฅผ ์์๋ด ๋๋ค."+---++# ์์ฒญ๊ณผ ์๋ต {#requests-responses}++!!! success "์์ ์ ํ์ธ"++ 1. [์์ํ๊ธฐ](getting-started.md)๋ฅผ ์ฝ๊ณ ๊ฐ๋จํ ์คํ์ด๋๋ฅผ ๋ง๋ค๊ณ ์คํํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.++์ด ํ์ด์ง๋ `Request` ๊ฐ์ฒด๋ฅผ ์์ธํ ์ค๋ช ํฉ๋๋ค. ์์ฒญ ๋ง๋ค๊ธฐ, ์ฝ๋ฐฑ ๊ฐ ๋ฐ์ดํฐ ์ ๋ฌ, ์ฐ์ ์์์ ์ค๋ณต ์ ๊ฑฐ ์ ์ด, `response.follow()`๋ก ๋งํฌ ๋ฐ๋ผ๊ฐ๊ธฐ๋ฅผ ๋ค๋ฃน๋๋ค.++## Request ๊ฐ์ฒด {#the-request-object}++`Request`๋ ๊ฐ์ ธ์ฌ URL์ ๋ํ๋ ๋๋ค. ์ง์ ๋ง๋ค๊ฑฐ๋ `response.follow()`๋ก ๋ง๋ค ์ ์์ต๋๋ค.++```python+from scrapling.spiders import Request++# Direct construction+request = Request(+ "https://example.com/page",+ callback=self.parse_page,+ priority=5,+)++# Via response.follow (preferred in callbacks)+request = response.follow("/page", callback=self.parse_page)+```++`Request`์ ์ ๋ฌํ ์ ์๋ ์ธ์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++| ์ธ์ | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|---------------|------------|------------|-------------------------------------------------------------------------------------------------------|+| `url` | `str` | *ํ์* | ๊ฐ์ ธ์ฌ URL |+| `sid` | `str` | `""` | ์ฌ์ฉํ ์ธ์ ์ ID์ ๋๋ค. [์ธ์ ](sessions.md)์ ์ฐธ๊ณ ํ์ธ์ |+| `callback` | `callable` | `None` | ์๋ต์ ์ฒ๋ฆฌํ ๋น๋๊ธฐ ์ ๋๋ ์ดํฐ ๋ฉ์๋์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `parse()`์ ๋๋ค |+| `priority` | `int` | `0` | ๊ฐ์ด ํด์๋ก ๋จผ์ ์ฒ๋ฆฌํฉ๋๋ค |+| `dont_filter` | `bool` | `False` | `True`์ด๋ฉด ์ค๋ณต ์ ๊ฑฐ๋ฅผ ๊ฑด๋๋ฐ๊ณ ๊ฐ์ ์์ฒญ์ ํ์ฉํฉ๋๋ค |+| `meta` | `dict` | `{}` | ์๋ต์ ์ ๋ฌํ ์์์ ๋ฉํ๋ฐ์ดํฐ |+| `**kwargs` | | | ์ธ์ ์ ๊ฐ์ ธ์ค๊ธฐ ๋ฉ์๋์ ์ ๋ฌํ ์ถ๊ฐ ํค์๋ ์ธ์์ ๋๋ค. ์: `headers`, `method`, `data` |++์ถ๊ฐ ํค์๋ ์ธ์๋ ์ธ์ ์ ์ง์ ์ ๋ฌํฉ๋๋ค. ์๋ฅผ ๋ค์ด POST ์์ฒญ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++```python+yield Request(+ "https://example.com/api",+ method="POST",+ data={"key": "value"},+ callback=self.parse_result,+)+```++## Response.follow() {#responsefollow}++์ฝ๋ฐฑ์์ ๋ค์ ์์ฒญ์ ๋ง๋ค ๋๋ `response.follow()`๋ฅผ ๊ถ์ฅํฉ๋๋ค. `Request`๋ฅผ ์ง์ ๋ง๋๋ ๊ฒ๋ณด๋ค ๋ค์๊ณผ ๊ฐ์ ์ฅ์ ์ด ์์ต๋๋ค.++- **์๋ URL**์ ํ์ฌ ํ์ด์ง URL ๊ธฐ์ค์ผ๋ก ์๋ ๋ณํํฉ๋๋ค.+- **Referer ํค๋**์ ๊ธฐ๋ณธ์ ์ผ๋ก ํ์ฌ ํ์ด์ง URL์ ์ค์ ํฉ๋๋ค.+- **์ธ์ ์ธ์**๋ ์๋ ์์ฒญ์์ ์์ํฉ๋๋ค. ํค๋์ ํ๋ก์ ์ค์ ๋ฑ์ด ํด๋นํฉ๋๋ค. ๋จ, `method`, `params`, `data`, `json`, `files`, `multipart`๋ ์ ์ธํ๋ฏ๋ก ๋งํฌ๋ ์ผ๋ฐ GET์ผ๋ก ๊ฐ์ ธ์ต๋๋ค.+- **์ฝ๋ฐฑ, ์ธ์ ID, ์ฐ์ ์์**๋ฅผ ์ง์ ํ์ง ์์ผ๋ฉด ์๋ ์์ฒญ์ ๊ฐ์ ์์ํฉ๋๋ค.++```python+async def parse(self, response: Response):+ # Minimal - inherits callback, sid, priority from current request+ yield response.follow("/next-page")++ # Override specific fields+ yield response.follow(+ "/product/123",+ callback=self.parse_product,+ priority=10,+ )++ # Pass additional metadata to+ yield response.follow(+ "/details",+ callback=self.parse_details,+ meta={"category": "electronics"},+ )+```++| ์ธ์ | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|--------------------|------------|------------|------------------------------------------------------------|+| `url` | `str` | *ํ์* | ๋ฐ๋ผ๊ฐ ์ ๋ ๋๋ ์๋ URL |+| `sid` | `str` | `""` | ์ธ์ ID์ ๋๋ค. ๋น์ด ์์ผ๋ฉด ์๋ ์์ฒญ์์ ์์ํฉ๋๋ค |+| `callback` | `callable` | `None` | ์ฝ๋ฐฑ ๋ฉ์๋์ ๋๋ค. `None`์ด๋ฉด ์๋ ์์ฒญ์์ ์์ํฉ๋๋ค |+| `priority` | `int` | `None` | ์ฐ์ ์์์ ๋๋ค. `None`์ด๋ฉด ์๋ ์์ฒญ์์ ์์ํฉ๋๋ค |+| `dont_filter` | `bool` | `False` | ์ค๋ณต ์ ๊ฑฐ๋ฅผ ๊ฑด๋๋๋๋ค |+| `meta` | `dict` | `None` | ํ์ฌ ์๋ต์ ๋ฉํ๋ฐ์ดํฐ์ ํฉ์น ๋ฉํ๋ฐ์ดํฐ |+| **`referer_flow`** | `bool` | `True` | ํ์ฌ URL์ Referer ํค๋๋ก ์ค์ ํฉ๋๋ค |+| `**kwargs` | | | ์๋ ์์ฒญ์ ์ธ์ ์ธ์์ ํฉ์นฉ๋๋ค |++### Referer ์ ๋ฌ ๋๊ธฐ {#disabling-referer-flow}++๊ธฐ๋ณธ์ ์ผ๋ก `response.follow()`๋ ํ์ฌ ํ์ด์ง URL์ `Referer` ํค๋๋ก ์ค์ ํฉ๋๋ค. ๋๋ ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์ฌ์ฉํ์ธ์.++```python+yield response.follow("/page", referer_flow=False)+```++## ์ฝ๋ฐฑ {#callbacks}++์ฝ๋ฐฑ์ ์๋ต์ ์ฒ๋ฆฌํ๋ ์คํ์ด๋์ ๋น๋๊ธฐ ์ ๋๋ ์ดํฐ ๋ฉ์๋์ ๋๋ค. ๋ค์ ์ธ ํ์ ์ค ํ๋๋ฅผ `yield`๋ก ๋ด๋ณด๋ด์ผ ํฉ๋๋ค.++- **`dict`**: ๊ฒฐ๊ณผ์ ์ถ๊ฐํ ์์ง ํญ๋ชฉ์ ๋๋ค.+- **`Request`**: ํ์ ์ถ๊ฐํ ๋ค์ ์์ฒญ์ ๋๋ค.+- **`None`**: ์๋ฆผ ์์ด ๋ฌด์ํฉ๋๋ค.++```python+class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]++ async def parse(self, response: Response):+ # Yield items (dicts)+ yield {"url": response.url, "title": response.css("title::text").get("")}++ # Yield follow-up requests+ for link in response.css("a::attr(href)").getall():+ yield response.follow(link, callback=self.parse_page)++ async def parse_page(self, response: Response):+ yield {"content": response.css("article::text").get("")}+```++!!! tip "์ฐธ๊ณ "++ ๋ชจ๋ ์ฝ๋ฐฑ์ `async def`๋ก ์ ์ํ๊ณ `return` ๋์ `yield`๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค. ๋ค์ ์์ฒญ ์์ด ํญ๋ชฉ๋ง ๋ด๋ณด๋ด๋๋ผ๋ ๋น๋๊ธฐ ์ ๋๋ ์ดํฐ์ฌ์ผ ํฉ๋๋ค.++## ์์ฒญ ์ฐ์ ์์ {#request-priority}++์ฐ์ ์์ ๊ฐ์ด ๋์ ์์ฒญ์ ๋จผ์ ์ฒ๋ฆฌํฉ๋๋ค. ์ผ๋ถ ํ์ด์ง๋ฅผ ๋ค๋ฅธ ํ์ด์ง๋ณด๋ค ๋จผ์ ์ฒ๋ฆฌํด์ผ ํ ๋ ์ ์ฉํฉ๋๋ค.++```python+async def parse(self, response: Response):+ # High priority - process product pages first+ for link in response.css("a.product::attr(href)").getall():+ yield response.follow(link, callback=self.parse_product, priority=10)++ # Low priority - pagination links processed after products+ next_page = response.css("a.next::attr(href)").get()+ if next_page:+ yield response.follow(next_page, callback=self.parse, priority=0)+```++`response.follow()`์์๋ ์ ๊ฐ์ ์ง์ ํ์ง ์์ผ๋ฉด ์๋ ์์ฒญ์ ์ฐ์ ์์๋ฅผ ์์ํฉ๋๋ค.++## ์ค๋ณต ์ ๊ฑฐ {#deduplication}++์คํ์ด๋๋ URL, HTTP ๋ฉ์๋, ์์ฒญ ๋ณธ๋ฌธ, ์ธ์ ID๋ก ์ง๋ฌธ์ ๊ณ์ฐํด ์ค๋ณต ์์ฒญ์ ์ ๊ฑฐํฉ๋๋ค. ๋ ์์ฒญ์ ์ง๋ฌธ์ด ๊ฐ์ผ๋ฉด ๋ ๋ฒ์งธ ์์ฒญ์ ์๋ฆผ ์์ด ์ ์ธํฉ๋๋ค.++๋ก๊ทธ์ธ ํ ํ์ด์ง๋ฅผ ๋ค์ ๋ฐฉ๋ฌธํ๋ ๊ฒฝ์ฐ์ฒ๋ผ ์ค๋ณต ์์ฒญ์ด ํ์ํ๋ฉด `dont_filter=True`๋ฅผ ์ค์ ํ์ธ์.++```python+yield Request("https://example.com/dashboard", dont_filter=True, callback=self.parse_dashboard)++# Or with response.follow+yield response.follow("/dashboard", dont_filter=True, callback=self.parse_dashboard)+```++์คํ์ด๋์ ํด๋์ค ์์ฑ์ผ๋ก ์ง๋ฌธ์ ํฌํจํ ๋ด์ฉ์ ์กฐ์ ํ ์ ์์ต๋๋ค.++| ์์ฑ | ๊ธฐ๋ณธ๊ฐ | ๋์ |+|----------------------|---------|-----------------------------------------------------------------------------------------------------------------|+| `fp_include_kwargs` | `False` | ํค๋ ๋ฑ ์ธ์ ์ ๊ฐ์ ธ์ค๊ธฐ ๋ฉ์๋์ ์ ๋ฌํ ์ถ๊ฐ ์์ฒญ ์ธ์๋ฅผ ์ง๋ฌธ์ ํฌํจํฉ๋๋ค |+| `fp_keep_fragments` | `False` | ์ง๋ฌธ์ ๊ณ์ฐํ ๋ URL ํ๋๊ทธ๋จผํธ(`#section`)๋ฅผ ์ ์งํฉ๋๋ค |+| `fp_include_headers` | `False` | ์์ฒญ ํค๋๋ฅผ ์ง๋ฌธ์ ํฌํจํฉ๋๋ค |++์๋ฅผ ๋ค์ด `https://example.com/page#section1`๊ณผ `https://example.com/page#section2`๋ฅผ ์๋ก ๋ค๋ฅธ URL๋ก ์ฒ๋ฆฌํ๋ ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์ค์ ํ์ธ์.++```python+class MySpider(Spider):+ name = "my_spider"+ fp_keep_fragments = True+ # ...+```++## ์์ฒญ ๋ฉํ๋ฐ์ดํฐ {#request-meta}++`meta` ๋์ ๋๋ฆฌ๋ก ์ฝ๋ฐฑ ์ฌ์ด์ ์ํ๋ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌํ ์ ์์ต๋๋ค. ๋ค๋ฅธ ํ์ด์ง๋ฅผ ์ฒ๋ฆฌํ ๋ ์ด์ ํ์ด์ง์ ์ ๋ณด๊ฐ ํ์ํ๋ฉด ์ ์ฉํฉ๋๋ค.++```python+async def parse(self, response: Response):+ for product in response.css("div.product"):+ category = product.css("span.category::text").get("")+ link = product.css("a::attr(href)").get()+ if link:+ yield response.follow(+ link,+ callback=self.parse_product,+ meta={"category": category},+ )++async def parse_product(self, response: Response):+ yield {+ "name": response.css("h1::text").get(""),+ "price": response.css(".price::text").get(""),+ # Access meta from the request+ "category": response.meta.get("category", ""),+ }+```++`response.follow()`๋ ํ์ฌ ์๋ต์ ๋ฉํ๋ฐ์ดํฐ์ ์ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ํฉ์นฉ๋๋ค. ์ ๊ฐ์ด ์ฐ์ ํฉ๋๋ค.++์คํ์ด๋ ์์คํ ์ ์ผ๋ถ ๋ฉํ๋ฐ์ดํฐ๋ ์๋์ผ๋ก ์ ์ฅํฉ๋๋ค. ์๋ฅผ ๋ค์ด ํ๋ก์ ์ํ์ ์ฌ์ฉํ๋ฉด ์์ฒญ์ ์ฌ์ฉํ ํ๋ก์๋ฅผ `response.meta["proxy"]`์์ ํ์ธํ ์ ์์ต๋๋ค.diff --git a/docs/locales/ko/spiders/sessions.md b/docs/locales/ko/spiders/sessions.mdnew file mode 100644index 0000000..2474b22--- /dev/null+++ b/docs/locales/ko/spiders/sessions.md@@ -0,0 +1,231 @@+---+title: "ํ ํฌ๋กค๋ฌ์์ HTTP ์ธ์ ๊ณผ ๋ธ๋ผ์ฐ์ ์ธ์ ์ฌ์ฉํ๊ธฐ"+description: "์ด๋ฆ์ด ์๋ ์ธ์ ์ ์ค์ ํ๊ณ HTTP ๋๋ ๋ธ๋ผ์ฐ์ Fetcher๋ก ์์ฒญ์ ๋ณด๋ด์ธ์. ์ฟ ํค๋ฅผ ์ฌ์ฌ์ฉํ๊ณ ํ์ํ ๋ ์ธ์ ์ ์์ํ๋ฉฐ API ๊ธฐ๋ก์ ํ์ธํฉ๋๋ค."+---++# ์คํ์ด๋ ์ธ์ {#spiders-sessions}++!!! success "์์ ์ ํ์ธ"++ 1. [์์ํ๊ธฐ](getting-started.md)๋ฅผ ์ฝ๊ณ ๊ฐ๋จํ ์คํ์ด๋๋ฅผ ๋ง๋ค๊ณ ์คํํ๋ ๋ฐฉ๋ฒ์ ์์๋์ธ์.+ 2. [Fetcher ๊ธฐ๋ณธ ์ฌํญ](../fetching/choosing.md)๊ณผ HTTP ์ธ์ , Stealthy ์ธ์ ์ ์ฐจ์ด๋ฅผ ์์๋์ธ์.++์คํ์ด๋๋ ์ฌ๋ฌ Fetcher ์ธ์ ์ ๋์์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ๊ฐ๋จํ ํ์ด์ง์๋ ๋น ๋ฅธ HTTP ์ธ์ ์, ๋ณดํธ๋ ํ์ด์ง์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด ํ์ด์ง์์ ์ธ์ ์ค์ ๊ณผ ์ฌ์ฉ๋ฒ์ ์์๋ด ๋๋ค.++## ์ธ์ ์ด๋? {#what-are-sessions}++์ธ์ ์ ๋ฏธ๋ฆฌ ์ค์ ํ Fetcher ์ธ์คํด์ค๋ก, ํฌ๋กค๋งํ๋ ๋์ ๊ณ์ ์คํ๋ฉ๋๋ค. ์์ฒญ๋ง๋ค ์ ์ฐ๊ฒฐ์ด๋ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ง๋๋ ๋์ ์ธ์ ์ ์ฌ์ฌ์ฉํ๋ฏ๋ก ๋ ๋น ๋ฅด๊ณ ์์๋ ์ ์ฝํฉ๋๋ค.++๊ธฐ๋ณธ์ ์ผ๋ก ๋ชจ๋ ์คํ์ด๋๋ [FetcherSession](../fetching/static.md) ํ๋๋ฅผ ๋ง๋ญ๋๋ค. `configure_sessions()`๋ฅผ ์ฌ์ ์ํ๋ฉด ์ธ์ ์ ์ถ๊ฐํ๊ฑฐ๋ ๊ธฐ๋ณธ ์ธ์ ์ ๋ฐ๊ฟ ์ ์์ต๋๋ค. ์๋ ํ์ฒ๋ผ ๊ฐ ์ธ์ ์ ๋น๋๊ธฐ ๋ฒ์ ๋ง ์ฌ์ฉํด์ผ ํฉ๋๋ค.+++| ์ธ์ ์ข ๋ฅ | ์ฉ๋ |+|-------------------------------------------------|------------------------------------------|+| [FetcherSession](../fetching/static.md) | JavaScript ์๋ ๋น ๋ฅธ HTTP ์์ฒญ |+| [AsyncStealthySession](../fetching/stealthy.md) | JavaScript, ๋ธ๋ผ์ฐ์ ์๋ํ, ๋ด ์ฐจ๋จ ์ฐํ |+++## ์ธ์ ์ค์ ํ๊ธฐ {#configuring-sessions}++์คํ์ด๋์ `configure_sessions()`๋ฅผ ์ฌ์ ์ํ์ธ์. `manager`๋ `SessionManager` ์ธ์คํด์ค์ ๋๋ค. `manager.add()`๋ก ์ธ์ ์ ๋ฑ๋กํฉ๋๋ค.++```python+from scrapling.spiders import Spider, Response+from scrapling.fetchers import FetcherSession++class MySpider(Spider):+ name = "my_spider"+ start_urls = ["https://example.com"]++ def configure_sessions(self, manager):+ manager.add("default", FetcherSession())++ async def parse(self, response: Response):+ yield {"title": response.css("title::text").get("")}+```++`manager.add()`์ ์ธ์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.++| ์ธ์ | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |+|--------------|-----------|------------|----------------------------------------------|+| `session_id` | `str` | *ํ์* | ์์ฒญ์์ ์ด ์ธ์ ์ ์ง์ ํ ์ด๋ฆ |+| `session` | `Session` | *ํ์* | ์ธ์ ์ธ์คํด์ค |+| `default` | `bool` | `False` | ๊ธฐ๋ณธ ์ธ์ ์ผ๋ก ์ค์ ํฉ๋๋ค |+| `lazy` | `bool` | `False` | ์ฒ์ ์ฌ์ฉํ ๋๋ง ์ธ์ ์ ์์ํฉ๋๋ค |++!!! note "์ฐธ๊ณ "++ 1. ์์ฒญ์ ์ธ์ ์ ์ง์ ํ์ง ์์ผ๋ฉด ๊ธฐ๋ณธ ์ธ์ ์ ์ฌ์ฉํฉ๋๋ค. ๊ธฐ๋ณธ ์ธ์ ์ ๋ค์ ๋ ๋ฐฉ๋ฒ์ผ๋ก ์ ํด์ง๋๋ค.+ 1. ๊ด๋ฆฌ์์ ์ฒ์ ์ถ๊ฐํ ์ธ์ ์ด ์๋์ผ๋ก ๊ธฐ๋ณธ ์ธ์ ์ด ๋ฉ๋๋ค.+ 2. ์ธ์ ์ ์ถ๊ฐํ ๋ `default=True`๋ฅผ ์ง์ ํฉ๋๋ค.+ 2. ์ธ์ ์ธ์คํด์ค๋ฅผ ๋ฏธ๋ฆฌ ์์ํ ํ์๋ ์์ต๋๋ค. ์คํ์ด๋๊ฐ ์์ง ์์ํ์ง ์์ ์ธ์ ์ ํ์ธํ๊ณ ์์ํฉ๋๋ค.+ 3. ํ์ํ ๋๋ง ์ธ์ ์ ์์ํ๋ ค๋ฉด ์ถ๊ฐํ ๋ `lazy`๋ฅผ ์ฌ์ฉํ์ธ์. ์๋ฅผ ๋ค์ด ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํ์ด๋ ์์ ์์ ์ด ์๋๋ผ ์ค์ ๋ก ํ์ํ ๋ ์ด ์ ์์ต๋๋ค.++## ์ฌ๋ฌ ์ธ์ ์ ์ฐ๋ ์คํ์ด๋ {#multi-session-spider}++๋ชฉ๋ก ํ์ด์ง์๋ ๋น ๋ฅธ HTTP ์ธ์ ์, ๋ด ์ฐจ๋จ์ด ์๋ ์์ธ ํ์ด์ง์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ๋ฅผ ์ฌ์ฉํ๋ ์์ ๋๋ค.++```python+from scrapling.spiders import Spider, Response+from scrapling.fetchers import FetcherSession, AsyncStealthySession++class ProductSpider(Spider):+ name = "products"+ start_urls = ["https://shop.example.com/products"]++ def configure_sessions(self, manager):+ # Fast HTTP for listing pages (default)+ manager.add("http", FetcherSession())++ self.browser_session = AsyncStealthySession(+ headless=True,+ network_idle=True,+ record_requests=True,+ )+ manager.add("stealth", self.browser_session)++ async def parse(self, response: Response):+ for link in response.css("a.product::attr(href)").getall():+ # Route product pages through the stealth session+ yield response.follow(link, sid="stealth", callback=self.parse_product)++ next_page = response.css("a.next::attr(href)").get()+ if next_page:+ yield response.follow(next_page)++ async def parse_product(self, response: Response):+ yield {+ "name": response.css("h1::text").get(""),+ "price": response.css(".price::text").get(""),+ }++ async def on_close(self):+ for api_response in self.browser_session.network.search(+ url_pattern=r"https://api\.shop\.example\.com/.*", limit=None+ ):+ self.logger.info(f"Saved API response: {api_response.url} ({api_response.status})")+```++์ด ์๋ ๋ธ๋ผ์ฐ์ ์ธ์คํด์ค๋ฅผ ์ ์งํ๊ณ , ์ธ์ ์ ๋ซ๊ธฐ ์ ์ `on_close()`์์ ์ ์ฅ๋ API ๊ธฐ๋ก์ ํ ๋ฒ ์ฝ์ต๋๋ค. ๊ธฐ๋ก์ ๋ชจ๋ ์ํ ํ์ด์ง๋ฅผ ํฌํจํ๋ฉฐ ๋ซ์ ๋ค์๋ ์ฝ์ ์ ์์ต๋๋ค. ์์ง ์ ์ฅ ์ค์ธ ๊ธฐ๋ก์ ๊ธฐ๋ค๋ฆฌ์ง ์๊ณ , ๋ณด๊ด ๊ฐ์ ์ ํ๋ ๊ณ์ ์ ์ฉ๋ฉ๋๋ค.++ํต์ฌ์ ๊ฐ ์์ฒญ์ ์ฌ์ฉํ ์ธ์ ์ ์ ํ๋ `sid`์ ๋๋ค. `sid` ์์ด `response.follow()`๋ฅผ ํธ์ถํ๋ฉด ์๋ ์์ฒญ์ ์ธ์ ID๋ฅผ ์์ํฉ๋๋ค.++์ธ์ ์ด ์๋ก ๋ค๋ฅธ ํด๋์ค์ผ ํ์๋ ์์ต๋๋ค. ๊ฐ์ ํด๋์ค์ ์ธ์คํด์ค๋ฅผ ์๋ก ๋ค๋ฅธ ์ค์ ์ผ๋ก ์ฌ์ฉํ ์๋ ์์ต๋๋ค.++```python+from scrapling.spiders import Spider, Response+from scrapling.fetchers import FetcherSession++class ProductSpider(Spider):+ name = "products"+ start_urls = ["https://shop.example.com/products"]++ def configure_sessions(self, manager):+ chrome_requests = FetcherSession(impersonate="chrome")+ firefox_requests = FetcherSession(impersonate="firefox")++ manager.add("chrome", chrome_requests)+ manager.add("firefox", firefox_requests)++ async def parse(self, response: Response):+ for link in response.css("a.product::attr(href)").getall():+ yield response.follow(link, callback=self.parse_product)++ next_page = response.css("a.next::attr(href)").get()+ if next_page:+ yield response.follow(next_page, sid="firefox")++ async def parse_product(self, response: Response):+ yield {+ "name": response.css("h1::text").get(""),+ "price": response.css(".price::text").get(""),+ }+```++๋๋ ํน์ ์์ฒญ์ ์ํด ๋ณ๋์ ์ฟ ํค์ ์ํ๋ฅผ ๊ฐ์ง ์ธ์ ์ ์ ์งํ ์๋ ์์ต๋๋ค.++## ์ธ์ ์ธ์ {#session-arguments}++`Request` ๋๋ `response.follow(**kwargs)`์ ์ ๋ฌํ ์ถ๊ฐ ํค์๋ ์ธ์๋ ์ธ์ ์ ๊ฐ์ ธ์ค๊ธฐ ๋ฉ์๋๋ก ์ ๋ฌํฉ๋๋ค. ์ธ์ ์ ์ฒด ์ค์ ์ ๋ฐ๊พธ์ง ์๊ณ ๊ฐ๋ณ ์์ฒญ์ ์กฐ์ ํ ์ ์์ต๋๋ค.++```python+async def parse(self, response: Response):+ # Pass extra headers for this specific request+ yield Request(+ "https://api.example.com/data",+ headers={"Authorization": "Bearer token123"},+ callback=self.parse_api,+ )++ # Use a different HTTP method+ yield Request(+ "https://example.com/submit",+ method="POST",+ data={"field": "value"},+ sid="firefox",+ callback=self.parse_result,+ )+```++!!! warning++ ๋ณดํต `FetcherSession`, `Fetcher`, `AsyncFetcher`์์๋ `.get()`, `.post()`์ฒ๋ผ ๋ฉ์๋๋ฅผ ํธ์ถํด HTTP ๋ฉ์๋๋ฅผ ์ ํํฉ๋๋ค. ํ์ง๋ง ์คํ์ด๋์์ `FetcherSession`์ ์ธ ๋๋ ์ด๋ ๊ฒ ํ์ง ์์ต๋๋ค. ๊ธฐ๋ณธ ์์ฒญ์ _HTTP GET_์ ๋๋ค. ๋ค๋ฅธ ๋ฉ์๋๋ฅผ ์ฐ๋ ค๋ฉด ์ ์์ฒ๋ผ `method` ์ธ์๋ก ์ ๋ฌํ์ธ์. ๋ชจ๋ ์ธ์ ์ข ๋ฅ์์ ๊ฐ์ `Request` ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํ ๋ฐฉ์์ ๋๋ค.++์์ ์ฌ๋ฌ ์ธ์ ์์ ๋ฑ๋กํ `"stealth"` ์ธ์ (`AsyncStealthySession`)์๋ `wait_selector`, `page_action`, `extra_headers` ๊ฐ์ ๋ธ๋ผ์ฐ์ ์ ์ฉ ์ธ์๋ ์ ๋ฌํ ์ ์์ต๋๋ค.++```python+async def parse(self, response: Response):+ # Use Cloudflare solver with the `AsyncStealthySession` we configured above+ yield Request(+ "https://nopecha.com/demo/cloudflare",+ sid="stealth",+ callback=self.parse_result,+ solve_cloudflare=True,+ block_webrtc=True,+ hide_canvas=True,+ google_search=True,+ )++ yield response.follow(+ "/dynamic-page",+ sid="stealth",+ callback=self.parse_dynamic,+ wait_selector="div.loaded",+ network_idle=True,+ )+```++!!! warning++ `response.follow()`๋ ์๋ ์์ฒญ์ ์ธ์ ์ธ์(**kwargs)๋ฅผ ์์ํ์ง๋ง `method`, `params`, `data`, `json`, `files`, `multipart`๋ ์ ์ธํฉ๋๋ค. ๋ฐ๋ผ์ POST ๋ค์์ ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ๋ฉด ์ผ๋ฐ GET์ ๋ณด๋ ๋๋ค. ์ ์ธ์๋ ์์ํ ์ธ์๋ณด๋ค ์ฐ์ ํฉ๋๋ค.++```python+from scrapling.spiders import Spider, Response+from scrapling.fetchers import FetcherSession++class ProductSpider(Spider):+ name = "products"+ start_urls = ["https://shop.example.com/products"]++ def configure_sessions(self, manager):+ manager.add("http", FetcherSession(impersonate='chrome'))++ async def parse(self, response: Response):+ # I don't want the follow request to impersonate a desktop Chrome like the previous request, but a mobile one+ # so I override it like this+ for link in response.css("a.product::attr(href)").getall():+ yield response.follow(link, impersonate="chrome131_android", callback=self.parse_product)++ next_page = response.css("a.next::attr(href)").get()+ if next_page:+ yield response.follow(next_page)++ async def parse_product(self, response: Response):+ yield {+ "name": response.css("h1::text").get(""),+ "price": response.css(".price::text").get(""),+ }+```+!!! info++ ์คํ์ด๋๊ฐ ์ข ๋ฃ๋ ๋ ๊ด๋ฆฌ์๊ฐ ์คํ ์ค์ธ ์ธ์ ์ ํ์ธํ๊ณ , ์คํ์ด๋๋ฅผ ๋ซ๊ธฐ ์ ์ ์๋์ผ๋ก ๋ซ์ต๋๋ค.diff --git a/docs/locales/ko/stylesheets b/docs/locales/ko/stylesheetsnew file mode 120000index 0000000..02c6ba6--- /dev/null+++ b/docs/locales/ko/stylesheets@@ -0,0 +1 @@+../../stylesheets\ No newline at end of filediff --git a/docs/locales/ko/tutorials/migrating_from_beautifulsoup.md b/docs/locales/ko/tutorials/migrating_from_beautifulsoup.mdnew file mode 100644index 0000000..4a66fcd--- /dev/null+++ b/docs/locales/ko/tutorials/migrating_from_beautifulsoup.md@@ -0,0 +1,100 @@+---+title: "BeautifulSoup์์ Scrapling์ผ๋ก ์ฎ๊ธฐ๊ธฐ"+description: "BeautifulSoup์ ์์ ์ ํ, ํ ์คํธ, ์์ฑ, ํ์ ์์ ์ Scrapling์ผ๋ก ๋ฐ๊ฟ ๋ณด์ธ์. ์ค์ ์์ ๋ก API ์ฐจ์ด๋ฅผ ํ์ธํฉ๋๋ค."+---++# BeautifulSoup์์ Scrapling์ผ๋ก ์ฎ๊ธฐ๊ธฐ {#migrating-from-beautifulsoup-to-scrapling}++BeautifulSoup์ ์ต์ํ๋ค๋ฉด Scrapling๋ ์ฝ๊ฒ ์์ํ ์ ์์ต๋๋ค. Scrapling์ ๋ ๋น ๋ฅด๊ฒ ์๋ํ๋ฉฐ, BeautifulSoup์ ํ์ฑ ๊ธฐ๋ฅ์ ๋ํด ์๋ก์ด ํ์ฑ ๊ธฐ๋ฅ๋ ์ ๊ณตํฉ๋๋ค. ํ๋์ ์ธ ์นํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ณ ์ฒ๋ฆฌํ๋ ๊ธฐ๋ฅ๋ ์์ต๋๋ค. ์ด ์๋ด๋ ๊ธฐ์กด BeautifulSoup ์ฝ๋๋ฅผ Scrapling์ผ๋ก ๋น ๋ฅด๊ฒ ๋ฐ๊พธ๋ ๋ฐ ๋์์ ์ค๋๋ค.++์๋ ํ์๋ ์น ์คํฌ๋ํ์์ ์์ฃผ ์ฌ์ฉํ๋ ์์ ์ ์ ๋ฆฌํ์ต๋๋ค. ๊ฐ ํ์์ ๊ฐ์ ์์ ์ BeautifulSoup๊ณผ Scrapling์ผ๋ก ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋น๊ตํ ์ ์์ต๋๋ค.++BeautifulSoup์ ์ผ๋ถ ๋จ์ถ ํํ์ Scrapling์ ์์ต๋๋ค. ์ด๊ฒ์ Scrapling์ด ๋ ๋น ๋ฅธ ์ด์ ์ค ํ๋์ ๋๋ค. ์ด๋ฏธ ์งง์ ํ ์ค๋ก ๊ฐ์ ๊ธฐ๋ฅ์ ์ธ ์ ์๋ค๋ฉด, ๊ทธ ์ค์ ๋ ์ค์ด๊ธฐ ์ํด ์ฑ๋ฅ์ ํฌ์ํ ํ์๋ ์๋ค๊ณ ์๊ฐํฉ๋๋ค :)+++| ์์ | BeautifulSoup ์ฝ๋ | Scrapling ์ฝ๋ |+|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|+| ํ์ ๊ฐ์ ธ์ค๊ธฐ | `from bs4 import BeautifulSoup` | `from scrapling.parser import Selector` |+| ๋ฌธ์์ด์ HTML ํ์ฑ | `soup = BeautifulSoup(html, 'html.parser')` | `page = Selector(html)` |+| ์์ ํ๋ ์ฐพ๊ธฐ | `element = soup.find('div', class_='example')` | `element = page.find('div', class_='example')` |+| ์ฌ๋ฌ ์์ ์ฐพ๊ธฐ | `elements = soup.find_all('div', class_='example')` | `elements = page.find_all('div', class_='example')` |+| ์์ ํ๋ ์ฐพ๊ธฐ(์์ 2) | `element = soup.find('div', attrs={"class": "example"})` | `element = page.find('div', {"class": "example"})` |+| ์์ ํ๋ ์ฐพ๊ธฐ(์์ 3) | `element = soup.find(re.compile("^b"))` | `element = page.find(lambda e: re.search(r"^b", e.tag) is not None)` |+| ์์ ํ๋ ์ฐพ๊ธฐ(์์ 4) | `element = soup.find(lambda e: len(list(e.children)) > 0)` | `element = page.find(lambda e: len(e.children) > 0)` |+| ์์ ํ๋ ์ฐพ๊ธฐ(์์ 5) | `element = soup.find(["a", "b"])` | `element = page.find(["a", "b"])` |+| ํ ์คํธ ๋ด์ฉ์ผ๋ก ์์ ์ฐพ๊ธฐ | `element = soup.find(text="some text")` | `element = page.find_by_text("some text", partial=False)` |+| CSS ์ ํ์๋ก ์ฒซ ๋ฒ์งธ ์ผ์น ์์ ์ฐพ๊ธฐ | `elements = soup.select_one('div.example')` | `elements = page.css('div.example').first` |+| CSS ์ ํ์๋ก ๋ชจ๋ ์ผ์น ์์ ์ฐพ๊ธฐ | `elements = soup.select('div.example')` | `elements = page.css('div.example')` |+| ํ์ด์ง๋ ์์์ ๋ณด๊ธฐ ์ข๊ฒ ์ ๋ฆฌํ ์์ค ๊ฐ์ ธ์ค๊ธฐ | `prettified = soup.prettify()` | `prettified = page.prettify()` |+| ํ์ด์ง๋ ์์์ ์ ๋ฆฌํ์ง ์์ ์์ค ๊ฐ์ ธ์ค๊ธฐ | `source = str(soup)` | `source = page.html_content` |+| ์์์ ํ๊ทธ ์ด๋ฆ ๊ฐ์ ธ์ค๊ธฐ | `name = element.name` | `name = element.tag` |+| ์์์ ํ ์คํธ ์ถ์ถ | `string = element.string` | `string = element.text` |+| ๋ฌธ์ ์ ์ฒด๋ ํ๊ทธ ์๋์ ๋ชจ๋ ํ ์คํธ ์ถ์ถ | `text = soup.get_text(strip=True)` | `text = page.get_all_text(strip=True)` |+| ์์ฑ ๋์ ๋๋ฆฌ์ ์ ๊ทผ | `attrs = element.attrs` | `attrs = element.attrib` |+| ์์ฑ ์ถ์ถ | `attr = element['href']` | `attr = element['href']` |+| ๋ถ๋ชจ๋ก ์ด๋ | `parent = element.parent` | `parent = element.parent` |+| ์์์ ๋ชจ๋ ์กฐ์ ๊ฐ์ ธ์ค๊ธฐ | `parents = list(element.parents)` | `parents = list(element.iterancestors())` |+| ์กฐ์ ์ค์์ ์์ ์ฐพ๊ธฐ | `target_parent = element.find_parent("a")` | `target_parent = element.find_ancestor(lambda p: p.tag == 'a')` |+| ๋ชจ๋ ํ์ ์์ ๊ฐ์ ธ์ค๊ธฐ | ์ง์ ์ ํจ | `siblings = element.siblings` |+| ๋ค์ ํ์ ์์ ๊ฐ์ ธ์ค๊ธฐ | `next_element = element.next_sibling` | `next_element = element.next` |+| ํ์ ์ค์์ ์์ ํ๋ ์ฐพ๊ธฐ | `target_sibling = element.find_next_sibling("a")`<br/>`target_sibling = element.find_previous_sibling("a")` | `target_sibling = element.siblings.search(lambda s: s.tag == 'a')` |+| ํ์ ์ค์์ ์ฌ๋ฌ ์์ ์ฐพ๊ธฐ | `target_sibling = element.find_next_siblings("a")`<br/>`target_sibling = element.find_previous_siblings("a")` | `target_sibling = element.siblings.filter(lambda s: s.tag == 'a')` |+| ๋ค์ ๋์ค๋ ์์ ์ค ํ๋ ์ฐพ๊ธฐ | `target_parent = element.find_next("a")` | `target_parent = element.below_elements.search(lambda p: p.tag == 'a')` |+| ๋ค์ ๋์ค๋ ์์ ์ค ์ฌ๋ฌ ๊ฐ ์ฐพ๊ธฐ | `target_parent = element.find_all_next("a")` | `target_parent = element.below_elements.filter(lambda p: p.tag == 'a')` |+| ์กฐ์ ์ค์์ ์์ ํ๋ ์ฐพ๊ธฐ | `target_parent = element.find_previous("a")` ยน | `target_parent = element.path.search(lambda p: p.tag == 'a')` |+| ์กฐ์ ์ค์์ ์ฌ๋ฌ ์์ ์ฐพ๊ธฐ | `target_parent = element.find_all_previous("a")` ยน | `target_parent = element.path.filter(lambda p: p.tag == 'a')` |+| ์ด์ ํ์ ์์ ๊ฐ์ ธ์ค๊ธฐ | `prev_element = element.previous_sibling` | `prev_element = element.previous` |+| ์์์ผ๋ก ์ด๋ | `children = list(element.children)` | `children = element.children` |+| ๋ชจ๋ ์์ ์์ ๊ฐ์ ธ์ค๊ธฐ | `children = list(element.descendants)` | `children = element.below_elements` |+| story ํด๋์ค๊ฐ ์๋ ๋ฌธ๋จ ์์ ๋งํฌ ์ ํ | `group = soup.select('p.story a')` | `group = page.css('p.story a')` |++์ปดํ์ผํ ์ ๊ท์์ Scrapling์ `find()`๋ `find_all()`์ ์ง์ ์ ๋ฌํ๋ฉด ํ๊ทธ ์ด๋ฆ์ด ์๋๋ผ ์์์ ํ ์คํธ๋ฅผ ๊ฒ์ฌํฉ๋๋ค. ํ๊ทธ ์ด๋ฆ์๋ ์ ํ์ lambda๋ฅผ ์ฌ์ฉํ๊ณ , ํ ์คํธ๋ฅผ ์ฐพ์ ๋๋ `page.find_by_regex(r"^b")`๋ฅผ ์ง์ ์ฌ์ฉํ์ธ์.++ยน **์ฐธ๊ณ :** BS4์ `find_previous`/`find_all_previous`๋ ๋ฌธ์ ์์์ ์์ ์๋ ๋ชจ๋ ์์๋ฅผ ๊ฒ์ํฉ๋๋ค. ๋ฐ๋ฉด Scrapling์ `path`๋ ์กฐ์, ์ฆ ๋ถ๋ชจ๋ฅผ ๋ฐ๋ผ ์ฌ๋ผ๊ฐ ์์๋ง ๋ฐํํฉ๋๋ค. ์์ ํ ๊ฐ์ ๊ธฐ๋ฅ์ ์๋์ง๋ง, ์กฐ์ ๊ฒ์์ผ๋ก ๊ฐ์ฅ ํํ ์ฌ์ฉ ์ฌ๋ก๋ฅผ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.++**๊ธฐ์ตํ ์ **: BeautifulSoup์ ํ์ฑ ํ ํ์ด์ง๋ฅผ ์์ ํ๊ณ ์กฐ์ํ๋ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. Scrapling์ ํ์ด์ง์์ ๋ฐ์ดํฐ๋ฅผ ๋น ๋ฅด๊ฒ ์์งํ๋ ๋ฐ ๋ ์ง์คํฉ๋๋ค. ์ถ์ถํ ๋ฐ์ดํฐ๋ ์ดํ์ ์ํ๋ ๋๋ก ์ฒ๋ฆฌํ ์ ์์ต๋๋ค. ๋ ๋๊ตฌ ๋ชจ๋ ์น ์คํฌ๋ํ์ ์ฌ์ฉํ ์ ์์ง๋ง Scrapling์ ๊ทธ ์ฉ๋์ ํนํ๋์ด ์์ต๋๋ค :)++### ์ ์ฒด ์์ {#putting-it-all-together}++BeautifulSoup๊ณผ Scrapling์ผ๋ก ์นํ์ด์ง์ ๋ชจ๋ ๋งํฌ๋ฅผ ์ถ์ถํ๋ ๊ฐ๋จํ ์์ ์ ๋๋ค.++**BeautifulSoup ์ฌ์ฉ:**++```python+import requests+from bs4 import BeautifulSoup++url = 'https://example.com'+response = requests.get(url)+soup = BeautifulSoup(response.text, 'html.parser')++links = soup.find_all('a')+for link in links:+ print(link['href'])+```++**Scrapling ์ฌ์ฉ:**++```python+from scrapling import Fetcher++url = 'https://example.com'+page = Fetcher.get(url)++links = page.css('a::attr(href)').getall()+for link in links:+ print(link)+```++Scrapling์ ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ์ ํ์ฑ์ ํ ๋จ๊ณ๋ก ํฉ์ณ ์ฝ๋๋ฅผ ๋ ๊ฐ๊ฒฐํ๊ณ ํจ์จ์ ์ผ๋ก ๋ง๋ญ๋๋ค.++!!! abstract "**์ถ๊ฐ ์ฐธ๊ณ ์ฌํญ:**"++ - **ํ์ ์ฐจ์ด**: BeautifulSoup์์๋ ํ์ฑ ์์ง์ ์ ํํ ์ ์์ผ๋ฉฐ `lxml`๋ ๊ทธ์ค ํ๋์ ๋๋ค. Scrapling์ ์์ง์ ๋ฐ๊พธ์ง ์๊ณ ์ฑ๋ฅ์ ์ํด ๊ธฐ๋ณธ์ผ๋ก `lxml`์ ์ฌ์ฉํฉ๋๋ค.+ - **์์ ํ์ **: BeautifulSoup์ ์์๋ `Tag`, Scrapling์ ์์๋ `Selector` ๊ฐ์ฒด์ ๋๋ค. ํ์๊ณผ ๋ฐ์ดํฐ ์ถ์ถ์๋ ๋น์ทํ ๋ฉ์๋์ ์์ฑ์ ์ ๊ณตํฉ๋๋ค.+ - **์ค๋ฅ ์ฒ๋ฆฌ**: ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ชจ๋ ์์๋ฅผ ์ฐพ์ง ๋ชปํ๋ฉด `None`์ ๋ฐํํฉ๋๋ค. ์๋ฅผ ๋ค์ด `soup.find()`๋ `page.find()`๊ฐ ๊ทธ๋ ์ต๋๋ค. Scrapling์ `page.css()`๋ ์ผ์นํ๋ ์์๊ฐ ์์ผ๋ฉด ๋น `Selectors` ๋ฆฌ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค. `page.css('.foo').first`๋ก ์ฒซ ๋ฒ์งธ ์ผ์น ์์ ๋๋ `None`์ ์์ ํ๊ฒ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. ์ค๋ฅ๋ฅผ ํผํ๋ ค๋ฉด ์์ฑ์ ์ ๊ทผํ๊ธฐ ์ ์ `None`์ด๋ ๋น ๊ฒฐ๊ณผ์ธ์ง ํ์ธํ์ธ์.+ - **ํ ์คํธ ์ถ์ถ**: Scrapling์ `TextHandler`๋ก ํ ์คํธ ์ฒ๋ฆฌ ๋ฉ์๋๋ฅผ ๋ ์ ๊ณตํฉ๋๋ค. ์๋ฅผ ๋ค์ด `clean()`์ ๋ถํ์ํ ๊ณต๋ฐฑ ๋ฌธ์, ์ฐ์๋ ๊ณต๋ฐฑ, ์์น ์๋ ๋ฌธ์๋ฅผ ์ ๊ฑฐํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. ์ ์ฒด ๋ชฉ๋ก์ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์.++๋ฌธ์์๋ Scrapling์ ๊ธฐ๋ฅ๊ณผ ๊ฐ ๋ฉ์๋์ ์ ๋ฌํ ์ ์๋ ์ธ์๊ฐ ์์ธํ ๋์ ์์ต๋๋ค.++์ด ์๋ด๊ฐ BeautifulSoup์์ Scrapling์ผ๋ก ์ฎ๊ธฐ๋ ๋ฐ ๋์์ด ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค. ์ฆ๊ฒ๊ฒ ์คํฌ๋ํํ์ธ์!diff --git a/docs/locales/ko/tutorials/replacing_ai.md b/docs/locales/ko/tutorials/replacing_ai.mdnew file mode 100644index 0000000..e40fb88--- /dev/null+++ b/docs/locales/ko/tutorials/replacing_ai.md@@ -0,0 +1,119 @@+---+title: "์์ ์ ์ธ ์น ์คํฌ๋ํ์ ์ํ ๋ฌด๋ฃ AI ๋์"+description: "Scrapling์ ํ์ด์ง ๋ณ๊ฒฝ, ๋ถ์์ ํ ์ ํ์, ๋ด ์ฐจ๋จ, ํ์ด์ง ์ด๋์ ๋์ํฉ๋๋ค. ํ์ด์ง๋ง๋ค LLM์ ํธ์ถํ ํ์๊ฐ ์์ต๋๋ค."+---++# Scrapling: ์์ ์ ์ธ ์น ์คํฌ๋ํ์ ์ํ ๋ฌด๋ฃ AI ๋์ {#scrapling-a-free-alternative-to-ai-for-robust-web-scraping}++์น ์คํฌ๋ํ์ ๋ฐ์ดํฐ ์ถ์ถ, ์ธ๋ฑ์ฑ, ๋ฐ์ดํฐ์ ์ค๋น ๋ฑ ๋ค์ํ ์ฉ๋๋ก ์ค๋ซ๋์ ์ฐ์์ต๋๋ค. ํ์ง๋ง ์๋ จ๋ ์ฌ์ฉ์๋ ์์ ์ ๋ฐฉํดํ๋ ๋ฌธ์ ๋ฅผ ๋ฐ๋ณตํด์ ๊ฒช์ต๋๋ค. ์ต๊ทผ์๋ ์ด๋ฐ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ค๊ณ AI ๊ธฐ๋ฐ ์น ์คํฌ๋ํ์ผ๋ก ์ฎ๊ฒจ ๊ฐ๋ ์์ง์์ด ๋๊ณ ์์ต๋๋ค.++์ด ๊ธ์์๋ ์์ฃผ ๊ฒช๋ ๋ฌธ์ , ๊ธฐ์ ์ด AI๋ฅผ ์ ํํ๋ ์ด์ , ๊ทธ ๋ฐฉ์์ ๋จ์ , ๊ทธ๋ฆฌ๊ณ Scrapling์ด AI ๋น์ฉ ์์ด ์ด๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ์ดํด๋ด ๋๋ค.++## ํํ ๋ฌธ์ ์ ์ด๋ ค์ด ๋ชฉํ {#common-issues-and-challenging-goals}++์น ์คํฌ๋ํ์ ์ค๋ ํ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๋ฐ๋ณตํด์ ๊ฒช์์ ๊ฒ์ ๋๋ค.++1. **์์ฃผ ๋ฐ๋๋ ์ฌ์ดํธ ๊ตฌ์กฐ**: DOM ๊ตฌ์กฐ๊ฐ ๋ฐ๋๋ฉด ๊ณ ์ ๋ XPath/CSS ์ ํ์๊ฐ ๋ ์ด์ ์๋ํ์ง ์์ต๋๋ค.+2. **๋ถ์์ ํ ์ ํ์**: ํด๋์ค ์ด๋ฆ๊ณผ ID๊ฐ ๋ฐ๋๊ฑฐ๋ ๋ฌด์์๋ก ์์ฑ๋์ด ์คํฌ๋ํผ๊ฐ ๊ณ ์ฅ ๋๊ฑฐ๋ ์์ฑํ๊ธฐ ์ด๋ ค์์ง๋๋ค.+3. **๋ณต์กํด์ง๋ ๋ด ์ฐจ๋จ**: CAPTCHA, ๋ธ๋ผ์ฐ์ ์ง๋ฌธ ๊ฒ์ฌ, ํ๋ ๋ถ์์ผ๋ก ๊ธฐ์กด ๋ฐฉ์์ ์คํฌ๋ํ์ด ์ด๋ ค์์ง๋๋ค.++์ด ๋ฐ์๋ ์ฌ๋ฌ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.++์ด๊ฒ์ ์ฌ์ดํธ๋ง๋ค ์ ์ฉ ์ฝ๋๋ฅผ ์์ฑํ ์ ์๋, ์ด๋ฏธ ์๊ณ ์๋ ์ฌ์ดํธ๋ฅผ ๋์์ผ๋ก ํ ๋์ ์ด์ผ๊ธฐ์ ๋๋ค.++์๋ก ๋ค๋ฅธ ๋ง์ ์ฌ์ดํธ๋ฅผ ๋ฒ์ฉ์ ์ผ๋ก ์์งํ๋ ค๊ณ ํ๋ฉด ์ ๋ฌธ์ ๋ ๋ ์ปค์ง๋๋ค. ๋ค์๊ณผ ๊ฐ์ ๋ฌธ์ ๋ ์ถ๊ฐ๋ฉ๋๋ค.++1. **์ฌ์ดํธ ๊ฐ์ ํฐ ์ฐจ์ด**: ์๋ง์ HTML ๊ตฌ์กฐ, CSS ์ฌ์ฉ ๋ฐฉ์, JavaScript ํ๋ ์์ํฌ, ๋ฐฑ์๋ ๊ธฐ์ ์ ๋์ํด์ผ ํฉ๋๋ค.+2. **ํ์ํ ๋ฐ์ดํฐ ์ฐพ๊ธฐ**: ์ฒ์ ๋ณด๋ ํ์ด์ง์์ ์ด๋ค ๋ฐ์ดํฐ๊ฐ ์ค์ํ์ง ์คํฌ๋ํผ๊ฐ ์ด๋ป๊ฒ ์ ์ ์์๊น์?+3. **๋ค์ํ ํ์ด์ง ์ด๋ ๋ฐฉ์**: ๋ฌดํ ์คํฌ๋กค, ํ์ด์ง ๋ฒํธ, โ๋ ๋ณด๊ธฐโ ๋ฒํผ์ ๊ฐ๊ฐ ๋ค๋ฅธ ์ ๊ทผ์ด ํ์ํฉ๋๋ค.++์ฌ๊ธฐ์ ๋ค๋ฅธ ๋ฌธ์ ๋ ๋ํด์ง๋๋ค.++๊ณตํต ๊ธฐ์ ์ ์ฐ์ง ์๋ ๋ค์ํ ์ฌ์ดํธ๋ฅผ ๋ฒ์ฉ์ ์ผ๋ก ์คํฌ๋ํํ๋ ค๋ฉด, ์ด ๋ชจ๋ ๋ฌธ์ ๋ฅผ ์ด๋ป๊ฒ ์์์ ์ผ๋ก ํด๊ฒฐํด์ผ ํ ๊น์?++## AI๊ฐ ๋์์ฃผ์ง๋ง ๋น์ฉ์ด ํฝ๋๋ค {#ai-to-the-rescue-but-at-a-high-cost}++AI๋ ํ์ด์ง ์์ค๋ฅผ ์ดํดํ๊ณ ํ์ํ ํญ๋ชฉ์ ์ฐพ๊ฑฐ๋ ์ ํ์๋ฅผ ๋ง๋ค ์ ์์ด ์ด๋ฐ ๋ฌธ์ ๋๋ถ๋ถ์ ์ฝ๊ฒ ํด๊ฒฐํ ์ ์์ต๋๋ค. ๋ฌผ๋ก ๋ด ์ฐจ๋จ์ ๋ค๋ฅธ ๋๊ตฌ๋ก ์ด๋ฏธ ํด๊ฒฐํ๋ค๋ ์ ์ ์ ๋๋ค :)++์ด ๋ฐฉ์์ ๋งค๋ ฅ์ ์ ๋๋ค. ์ ๋ AI, ํนํ ์์ฑํ AI์ ํฐ ๊ด์ฌ์ด ์์ต๋๋ค. ํ๋กฌํํธ๋ฅผ ๋ง๋ค๊ณ ๋ค๋ฌ๋ ๋ฐ ์๊ฐ์ด ๋ง์ด ๋ค ์ ์์ต๋๋ค. ๊ทธ๋๋ ๊ด์ฐฎ๋ค๋ฉด, ๊ณง ์ง์ง ๋ฌธ์ ๋ฅผ ๋ง๋๊ฒ ๋ฉ๋๋ค.++๋๋ถ๋ถ์ ์ฌ์ดํธ๋ ํ ํ์ด์ง์ ๋ง์ ๋ด์ฉ์ ๋ด๊ณ ์์ต๋๋ค. AI๊ฐ ์ฒ๋ฆฌํ ์ ์๋๋ก ๊ทธ ๋ด์ฉ์ ์ด๋ค ํํ๋ก๋ ์ ๋ฌํด์ผ ํฉ๋๋ค. ๊ทธ๋ฌ๋ฉด ํ ํฐ์ด ๋น ๋ฅด๊ฒ ์๋ชจ๋๊ณ ๋น์ฉ์ด ์ปค์ง๋๋ค.++๋น์ฉ์ ์ ํ ์ ๊ฒฝ ์ฐ์ง ์์๋ ๋๋ ์ํฉ์ด ์๋๋ผ๋ฉด ๋ ์ ๋ ดํ ๋ฐฉ๋ฒ์ ์ฐพ๊ฒ ๋ฉ๋๋ค. ์ด๋ Scrapling์ด ๋์์ด ๋ฉ๋๋ค :smile:++## Scrapling์ด ๋์๋๋ฆฝ๋๋ค {#scrapling-got-you-covered}++Scrapling์ ์น ์คํฌ๋ํ์์ ๋ง๋๋ ๊ฑฐ์ ๋ชจ๋ ๋ฌธ์ ์ ๋์ํ ์ ์์ต๋๋ค. ๋๋จธ์ง ๋ฌธ์ ๋ ์์ผ๋ก์ ์ ๋ฐ์ดํธ์์ ์ฐจ๊ทผ์ฐจ๊ทผ ํด๊ฒฐํด ๋๊ฐ ์์ ์ ๋๋ค.++### T1 ํด๊ฒฐ: ์์ฃผ ๋ฐ๋๋ ์ฌ์ดํธ ๊ตฌ์กฐ {#solving-issue-t1-rapidly-changing-website-structures}+์ด๋ฅผ ์ํด ๋ง๋ ๊ธฐ๋ฅ์ด [์ ์ํ ํ์ฑ](../parsing/adaptive.md)์ ๋๋ค. ์ด ๊ธฐ๋ฅ์ด ๋์ฌ ์ค ์์ํ์ จ์ ์๋ ์๊ฒ ๋ค์ :)++์คํฌ๋ํํ ๋ `adaptive`๋ฅผ ์ผ๋ฉด ์์์ ํน์ง์ ์ ์ฅํด ๋๊ณ , ์ฌ์ดํธ ๊ตฌ์กฐ๊ฐ ๋ฐ๋ ํ์๋ ๋ค์ ์ฐพ์ ์ ์์ต๋๋ค. ์ด๋ ค์ด ์ ์ ์์์ ์ด๋ค ๋ถ๋ถ์ด๋ ๋ฐ๋ ์ ์์ด ๊ณ ์ ๋ ์ ๋ณด์ ์์กดํ ์ ์๋ค๋ ๊ฒ์ ๋๋ค.++์ ์ํ ๊ธฐ๋ฅ์ ์์๋ฅผ ๊ตฌ๋ณํ๋ ์ ๋ณด๋ฅผ ์ ์ฅํฉ๋๋ค. ์ฌ์ดํธ ๊ตฌ์กฐ๊ฐ ๋ฐ๋๋ฉด ์ด์ ์์์ ๊ฐ์ฅ ๋น์ทํ ์์๋ฅผ ๋ฐํํฉ๋๋ค.++์์ธํ ์ค๋ช ๊ณผ ์ฌ๋ฌ ์์ ๋ [์ฌ๊ธฐ](../parsing/adaptive.md#how-the-adaptive-scraping-feature-works)์ ์์ต๋๋ค.++### T2 ํด๊ฒฐ: ๋ถ์์ ํ ์ ํ์ {#solving-issue-t2-unstable-selectors}+์น ์คํฌ๋ํ์ ์ค๋ ํ๋ค๋ฉด ํ ๋ฒ์ฏค์ ๊ฒช์์ ๊ฒ์ ๋๋ค. ID๋ ํด๋์ค๊ฐ ์๋ HTML, ๋ฌด์์ ํด๋์ค ์ด๋ฆ์ฒ๋ผ ๋ฏฟ๊ณ ์ธ ์ ๋ณด๊ฐ ์๋, ๋ค๋ฃจ๊ธฐ ์ด๋ ค์ด ์ฌ์ดํธ์ ๋๋ค.++์ด๋ด ๋๋ ์ผ๋ฐ์ ์ธ CSS/XPath ์ ํ์๊ฐ ์ต์ ์ด ์๋ ์ ์์ต๋๋ค. ๊ทธ๋์ Scrapling์ ์ธ ๊ฐ์ง ์ ํ ๋ฐฉ๋ฒ์ ๋ ์ ๊ณตํฉ๋๋ค.++1. [์์ ๋ด์ฉ์ผ๋ก ์ ํ](../parsing/selection.md#text-content-selection): `find_by_text`๋ก ํ ์คํธ๋ฅผ ์ฐพ๊ฑฐ๋, `find_by_regex`๋ก ํ ์คํธ์ ์ ๊ท์์ ์ ์ฉํฉ๋๋ค.+2. [๋ค๋ฅธ ์์์ ๋น์ทํ ์์ ์ ํ](../parsing/selection.md#finding-similar-elements): ์์ ํ๋๋ฅผ ์ฐพ์ผ๋ฉด ๋๋จธ์ง๋ Scrapling์ด ์ฐพ์ต๋๋ค.+3. [ํํฐ๋ก ์์ ์ ํ](../parsing/selection.md#filters-based-searching): ์์๊ฐ ๋ง์กฑํด์ผ ํ ์กฐ๊ฑด์ ์ง์ ํ๋ฉด Scrapling์ด ์ฐพ์ต๋๋ค.++๊ฐ ๋งํฌ์์ ์ฌ์ฉ๋ฒ์ ํ์ธํ ์ ์์ผ๋ฏ๋ก ์ฌ๊ธฐ์๋ ์ค๋ช ์ ๋ฐ๋ณตํ์ง ์๊ฒ ์ต๋๋ค.++### T3 ํด๊ฒฐ: ๋ณต์กํด์ง๋ ๋ด ์ฐจ๋จ {#solving-issue-t3-increasingly-complex-anti-bot-measures}+๋ณดํธ๋ ์ฌ์ดํธ์์๋ ํ๋ก์์ ์ฌ๋์ฒ๋ผ ๋ณด์ด๋ ๋์๋ง์ผ๋ก ๋ถ์กฑํ ์ ์์ต๋๋ค. [StealthyFetcher](../fetching/stealthy.md)๋ ๋ธ๋ผ์ฐ์ ์๋ํ์ ์ง๋ฌธ ๋ณด์ ๊ณผ ๋ด ์ฐจ๋จ ๋์ ์ต์ ์ ๊ฒฐํฉํฉ๋๋ค. Cloudflare Turnstile๊ณผ Interstitial ๊ฒ์ฆ์๋ `solve_cloudflare=True`๋ฅผ ์ฌ์ฉํ์ธ์.++### B1๊ณผ B2 ํด๊ฒฐ: ๋ค์ํ ์ฌ์ดํธ์ ํ์ํ ๋ฐ์ดํฐ ์ฐพ๊ธฐ {#solving-issues-b1-b2-extreme-website-diversity-identifying-relevant-data}++์ด๋ ค์ด ๋ฌธ์ ์ง๋ง Scrapling์ ์ ์ฐํ ๊ธฐ๋ฅ์ผ๋ก ๋์ํ ์ ์์ต๋๋ค.++์ฌ๋ฌ ์ฌ์ดํธ์์ AI๋ก ๊ฐ๊ฒฉ์ ์ถ์ถํ๋ ๋ถ๊ณผ ์ด์ผ๊ธฐํ ์ ์ด ์์ต๋๋ค. ๊ฐ๊ฒฉ๊ณผ ์ ๋ชฉ๋ง ํ์ํด์, AI์๊ฒ ๊ฐ๊ฒฉ์ ์ฐพ์ ๋ฌ๋ผ๊ณ ํ๊ณ ์์์ต๋๋ค.++์ ๋ ์ด ๊ฒฝ์ฐ AI๊ฐ ํ์ํ์ง ์๋ค๊ณ ์ค๋ช ํ๊ณ ๋ค์ ์ฝ๋๋ฅผ ์๋ก ๋ณด์ฌ ๋๋ ธ์ต๋๋ค.+```python+price_element = page.find_by_regex(r'ยฃ[\d\.,]+', first_match=True) # Get the first element that contains a text that matches price regex eg. ยฃ10.50+# If you want the container/element that contains the price element+price_element_container = price_element.parent or price_element.find_ancestor(lambda ancestor: ancestor.has_class('product')) # or other methods...+target_element_selector = price_element_container.generate_css_selector or price_element_container.generate_full_css_selector # or xpath+```+๊ทธ๋ถ์ ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์๋ ์ด๋ป๊ฒ ํ๋๋๊ณ ๋ฌผ์์ต๋๋ค.+```html+<span class='currency'> $ </span> <span class='a-price'> 45,000 </span>+```+๊ทธ๋์ ์ฝ๋๋ฅผ ์ด๋ ๊ฒ ๋ฐ๊ฟจ์ต๋๋ค.+```python+price_element_container = page.find_by_regex(r'[\d,]+', first_match=True).parent # Adjusted the regex for this example+full_price_data = price_element_container.get_all_text(separator="", strip=True) # Returns '$45,000' in this case+```+๊ทธ๋ถ์ ์ฉ๋์๋ ์ด๊ฒ์ผ๋ก ์ถฉ๋ถํ์ต๋๋ค. ์ฒซ ๋ฒ์งธ ์ ๊ท์์์ ์๋ฌด๊ฒ๋ ์ฐพ์ง ๋ชปํ๋ฉด ๋ค์ ์ ๊ท์์ ์๋ํ๋ ์์ผ๋ก ๊ตฌ์ฑํ ์ ์์ต๋๋ค. ๊ฐ์ฅ ํํ ํจํด๋ถํฐ ์ฒ๋ฆฌํ ๋ค ๋ ํํ ํจํด์ผ๋ก ๋ํ ๊ฐ์ธ์.+์กฐ๊ธ ์ง๋ฃจํ ์ ์์ง๋ง AI๋ณด๋ค ๋น์ฉ์ด ์ ๊ฒ ๋ญ๋๋ค.++์ด ์์ ์์ ์ ํ๊ณ ์ถ์ ์ ์ ๋ชจ๋ ๋ฌธ์ ์ AI๊ฐ ํ์ํ ๊ฒ์ ์๋๋ผ๋ ๊ฒ์ ๋๋ค. ์กฐ๊ธ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ ์๊ฐํ๋ฉด ๋น์ฉ์ ํฌ๊ฒ ์ค์ผ ์๋ ์์ต๋๋ค.++### B3 ํด๊ฒฐ: ๋ค์ํ ํ์ด์ง ์ด๋ ๋ฐฉ์ {#solving-issue-b3-pagination-variations}+ํ์ฌ Scrapling์๋ ํ์ด์ง ์ด๋ ๋งํฌ๋ฅผ ์๋์ผ๋ก ์ฐพ๋ ์ ์ฉ ๋ฉ์๋๊ฐ ์์ต๋๋ค. Spider๋ `response.follow()`๋ก ํ์ด์ง ์ด๋ ๋งํฌ๋ฅผ ๋ฐ๋ผ๊ฐ๋๋ค.++ํ์ง๋ง ํํ ํจํด์ ์ฐพ์ผ๋ฉด ๋๋ถ๋ถ์ ์ฌ์ดํธ์ ๋์ํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด `page.find_by_text('Next')['href']`, `page.find_by_text('load more')['href']`, ๋๋ `'a[href*="?page="]'`, `'a[href*="/page/"]'` ๊ฐ์ ์ ํ์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.++## ๋น์ฉ ๋น๊ต์ ์ ์ฝ ํจ๊ณผ {#cost-comparison-and-savings}+๊ฐ๋จํ ๋น๊ตํด ๋ณด๊ฒ ์ต๋๋ค.++| ํญ๋ชฉ | Scrapling | AI ๊ธฐ๋ฐ ๋๊ตฌ(Browse AI, Oxylabs ๋ฑ) |+|----------------|----------------------------------------------------------------------------|----------------------------------------------------------------------------|+| ๋น์ฉ | ๋ฌด๋ฃ์ด๋ฉฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ ํ์์ ๋ฐ๋ฅธ ์๊ธ์ด ์์ต๋๋ค | ์ ๋ฃ ์๊ธ์ ์ด๋ฉฐ ์ ๊ณต์ ์ฒด์ ์ฌ์ฉ๋์ ๋ฐ๋ผ ๊ฐ๊ฒฉ์ด ๋ฌ๋ผ์ง๋๋ค |+| ์ค์ | ์ฝ๊ฐ์ ๊ธฐ์ ์ง์๊ณผ ์๋ ์ค์ ์ด ํ์ํฉ๋๋ค | ๋๊ฐ ์ฝ๋๊ฐ ํ์ ์์ด ๋น์ ๋ฌธ๊ฐ๋ ์ฌ์ฉํ๊ธฐ ์ฝ์ต๋๋ค |+| ์ฌ์ฉ ๋ฐฉ์ | ์ฝ๋, ํฐ๋ฏธ๋, MCP ์๋ฒ๋ก ์ฌ์ฉํฉ๋๋ค | ์ ์ฒด๊ฐ ์ ๊ณตํ๋ ๊ธฐ๋ฅ์ ๋ฐ๋ผ ์ฃผ๋ก GUI๋ API๋ฅผ ์ฌ์ฉํฉ๋๋ค |+| ๊ท๋ชจ ํ์ฅ | ์ฌ์ฉ์์ ๊ตฌํ์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๋๋ค | ๋๊ท๋ชจ ์์ ์ ์ํ ๊ด๋ฆฌํ ์๋น์ค๊ฐ ์ ๊ณต๋ฉ๋๋ค |+| ๋ณํ ๋์ | `adaptive`์ ์ ํ์ ์ธ์ ์ ํ ๋ฐฉ๋ฒ์ผ๋ก ์ ์ฐํ๊ฒ ๋์ํฉ๋๋ค | AI๊ฐ ์๋์ผ๋ก ๋์ํ์ง๋ง ๋ณ๊ฒฝ์ด ์ฆ์ผ๋ฉด ๋น์ฉ์ด ํฝ๋๋ค |++ํ์ฌ ์๊ธ์ [Browse AI ์๊ธ](https://www.browse.ai/pricing)๊ณผ [Oxylabs Web Scraper API ์๊ธ](https://oxylabs.io/products/scraper-api/web/pricing)์ ํ์ธํ์ธ์.++## ๋ง๋ฌด๋ฆฌ {#conclusion}+AI๋ ๊ฐ๋ ฅํ์ง๋ง ๋ง์ ์น ์คํฌ๋ํ ์์ ์์๋ ๋น์ฉ์ด ๋๋ฌด ํด ์ ์์ต๋๋ค. Scrapling์ ํน์ ์ฌ์ดํธ์ ๋์ ๋ฒ์์ ์ฌ์ดํธ ๋ชจ๋์์ ์ค์ ๋ฌธ์ ๋ฅผ ๋ค๋ฃฐ ์ ์๋ ์ ์ฐํ๊ณ ๊ฒฝ์ ์ ์ธ ๋๊ตฌ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๋น์ผ AI ์๋ฃจ์ ์์ด ํด๊ฒฐํ ์ ์๋ ๊ฒฝ์ฐ๋ ๋ง์ต๋๋ค. `adaptive`, ๋ค์ํ ์ ํ ๋ฐฉ๋ฒ, ๊ณ ๊ธ Fetcher๋ฅผ ํ์ฉํ๋ฉด ๋ณํ์ ๊ฐํ ์คํฌ๋ํผ๋ฅผ ๋ ํจ์จ์ ์ผ๋ก ๋ง๋ค ์ ์์ต๋๋ค.++๋ฌธ์๋ฅผ ๋ ์ดํด๋ณด๊ณ Scrapling์ด ๋ค์ ์น ์คํฌ๋ํ ํ๋ก์ ํธ๋ฅผ ์ด๋ป๊ฒ ๊ฐ๋จํ๊ฒ ๋ง๋ค์ด ์ค ์ ์๋์ง ํ์ธํ์ธ์.diff --git a/docs/overrides/api/python/material/languages/ko.html.jinja b/docs/overrides/api/python/material/languages/ko.html.jinjanew file mode 100644index 0000000..573ba2c--- /dev/null+++ b/docs/overrides/api/python/material/languages/ko.html.jinja@@ -0,0 +1,17 @@+{% macro t(key) %}{{ {+ "ATTRIBUTE": "์์ฑ", "Attributes": "์์ฑ", "Attributes:": "์์ฑ:",+ "BOUND:": "์ํ:", "Bound or Constraints": "์ํ ๋๋ ์ ์ฝ ์กฐ๊ฑด",+ "Classes": "ํด๋์ค", "Classes:": "ํด๋์ค:", "CLASS": "ํด๋์ค",+ "Class Type Parameters:": "ํด๋์ค ํ์ ๋งค๊ฐ๋ณ์:", "CLASS TYPE PARAMETER": "ํด๋์ค ํ์ ๋งค๊ฐ๋ณ์",+ "CONSTRAINTS:": "์ ์ฝ ์กฐ๊ฑด:", "DEFAULT:": "๊ธฐ๋ณธ๊ฐ:", "Default": "๊ธฐ๋ณธ๊ฐ", "default:": "๊ธฐ๋ณธ๊ฐ:",+ "DESCRIPTION": "์ค๋ช ", "Description": "์ค๋ช ", "Examples:": "์์ :",+ "Functions": "ํจ์", "Functions:": "ํจ์:", "FUNCTION": "ํจ์",+ "Init Type Parameters:": "์ด๊ธฐํ ํ์ ๋งค๊ฐ๋ณ์:", "INIT TYPE PARAMETER": "์ด๊ธฐํ ํ์ ๋งค๊ฐ๋ณ์",+ "Methods:": "๋ฉ์๋:", "METHOD": "๋ฉ์๋", "Modules": "๋ชจ๋", "Modules:": "๋ชจ๋:", "MODULE": "๋ชจ๋",+ "Name": "์ด๋ฆ", "Other Parameters:": "๊ธฐํ ๋งค๊ฐ๋ณ์:", "PARAMETER": "๋งค๊ฐ๋ณ์", "Parameters:": "๋งค๊ฐ๋ณ์:",+ "RAISES": "๋ฐ์ํ๋ ์์ธ", "Raises:": "๋ฐ์ํ๋ ์์ธ:", "RECEIVES": "๋ฐ๋ ๊ฐ", "Receives:": "๋ฐ๋ ๊ฐ:",+ "required": "ํ์", "RETURNS": "๋ฐํ๊ฐ", "Returns:": "๋ฐํ๊ฐ:", "Source code in": "์์ค ์ฝ๋ ์์น",+ "TYPE:": "์๋ฃํ:", "Type": "์๋ฃํ", "Type Aliases": "ํ์ ๋ณ์นญ", "Type Aliases:": "ํ์ ๋ณ์นญ:",+ "TYPE ALIAS": "ํ์ ๋ณ์นญ", "Type Parameters:": "ํ์ ๋งค๊ฐ๋ณ์:", "TYPE PARAMETER": "ํ์ ๋งค๊ฐ๋ณ์",+ "WARNS": "๊ฒฝ๊ณ ", "Warns:": "๊ฒฝ๊ณ :", "YIELDS": "์์ฑํ๋ ๊ฐ", "Yields:": "์์ฑํ๋ ๊ฐ:"+}.get(key, "") }}{% endmacro %}diff --git a/docs/overrides/api/python/material/translations/ko.html.jinja b/docs/overrides/api/python/material/translations/ko.html.jinjanew file mode 100644index 0000000..72857ee--- /dev/null+++ b/docs/overrides/api/python/material/translations/ko.html.jinja@@ -0,0 +1,369 @@+{% set translations = {+ "<p>This class is returned by all engines as a way to unify the response type between different libraries.</p>": "<p>๋ชจ๋ ์์ง์ด ์ด ํด๋์ค๋ฅผ ๋ฐํํ์ฌ ์๋ก ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์๋ ๊ฐ์ ์๋ต ํ์ ์ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>HTTP status code.</p>": "<p>HTTP ์ํ ์ฝ๋์ ๋๋ค.</p>",+ "<p>HTTP status message.</p>": "<p>HTTP ์ํ ๋ฉ์์ง์ ๋๋ค.</p>",+ "<p>Response cookies.</p>": "<p>์๋ต ์ฟ ํค์ ๋๋ค.</p>",+ "<p>Response headers.</p>": "<p>์๋ต ํค๋์ ๋๋ค.</p>",+ "<p>Request headers sent with the request.</p>": "<p>์์ฒญ๊ณผ ํจ๊ป ๋ณด๋ธ ํค๋์ ๋๋ค.</p>",+ "<p>List of redirect responses, if any.</p>": "<p>๋ฆฌ๋๋ ์ ์ด ์์๋ค๋ฉด ํด๋น ์๋ต ๋ชฉ๋ก์ ๋๋ค.</p>",+ "<p>Metadata dictionary (e.g., proxy used).</p>": "<p>์ฌ์ฉํ ํ๋ก์ ๊ฐ์ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ๋ด์ ๋์ ๋๋ฆฌ์ ๋๋ค.</p>",+ "<p>Associated spider Request object (set by crawler, in the spiders framework).</p>": "<p>์ฐ๊ฒฐ๋ ์คํ์ด๋ Request ๊ฐ์ฒด์ ๋๋ค. ์คํ์ด๋ ํ๋ ์์ํฌ์์ ํฌ๋กค๋ฌ๊ฐ ์ค์ ํฉ๋๋ค.</p>",+ "<p>The main class that works as a wrapper for the HTML input data. Using this class, you can search for elements\nwith expressions in CSS, XPath, or with simply text. Check the docs for more info.</p>": "<p>์ ๋ ฅ HTML ๋ฐ์ดํฐ๋ฅผ ๋ค๋ฃจ๋ ์ฃผ์ ํด๋์ค์ ๋๋ค. CSS, XPath ๋๋ ๋จ์ํ ํ ์คํธ๋ก ์์๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.</p>",+ "<p>Here we try to extend module <code>lxml.html.HtmlElement</code> while maintaining a simpler interface, We are not\ninheriting from the <code>lxml.html.HtmlElement</code> because it's not pickleable, which makes a lot of reference jobs\nnot possible. You can test it here and see code explodes with <code>AssertionError: invalid Element proxy at...</code>.\nIt's an old issue with lxml, see <code>this entry <https://bugs.launchpad.net/lxml/+bug/736708></code></p>": "<p><code>lxml.html.HtmlElement</code>์ ๊ธฐ๋ฅ์ ๋ ๊ฐ๋จํ ์ธํฐํ์ด์ค๋ก ํ์ฅํฉ๋๋ค. <code>lxml.html.HtmlElement</code>๋ pickle๋ก ์ ์ฅํ ์ ์์ด ์ฌ๋ฌ ์ฐธ์กฐ ๊ด๋ จ ์์ ์ ์ ํํ๋ฏ๋ก ์ง์ ์์ํ์ง ์์ต๋๋ค. ์๋ํ๋ฉด <code>AssertionError: invalid Element proxy at...</code> ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. ์ค๋๋ lxml ๋ฌธ์ ์ด๋ฉฐ, <code>this entry <https://bugs.launchpad.net/lxml/+bug/736708></code>๋ฅผ ์ฐธ๊ณ ํ์ธ์.</p>",+ "<p>HTML content as either string or bytes.</p>": "<p>๋ฌธ์์ด ๋๋ ๋ฐ์ดํธ ํ์์ HTML ์ฝํ ์ธ ์ ๋๋ค.</p>",+ "<p>It allows storing a URL with the HTML data for retrieving later.</p>": "<p>HTML ๋ฐ์ดํฐ์ ํจ๊ป URL์ ์ ์ฅํ์ฌ ๋์ค์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.</p>",+ "<p>The encoding type that will be used in HTML parsing, default is <code>UTF-8</code></p>": "<p>HTML ํ์ฑ์ ์ฌ์ฉํ ์ธ์ฝ๋ฉ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ <code>UTF-8</code>์ ๋๋ค.</p>",+ "<p>Enabled by default, should always be enabled when parsing large HTML documents. This controls\nthe libxml2 feature that forbids parsing certain large documents to protect from possible memory exhaustion.</p>": "<p>๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ํฐ HTML ๋ฌธ์๋ฅผ ํ์ฑํ ๋๋ ํญ์ ์ผ ๋์ธ์. ๋ฉ๋ชจ๋ฆฌ ๋ถ์กฑ์ ๋ง๊ธฐ ์ํด ์ผ๋ถ ํฐ ๋ฌธ์์ ํ์ฑ์ ๊ธ์งํ๋ libxml2 ๊ธฐ๋ฅ์ ์ ์ดํฉ๋๋ค.</p>",+ "<p>Used internally to pass etree objects instead of text/body arguments, it takes the highest priority.\nDon't use it unless you know what you are doing!</p>": "<p>ํ ์คํธ๋ ๋ณธ๋ฌธ ๋์ etree ๊ฐ์ฒด๋ฅผ ์ ๋ฌํ๋ ๋ด๋ถ ์ธ์์ด๋ฉฐ ๊ฐ์ฅ ๋์ ์ฐ์ ์์๋ฅผ ๊ฐ์ง๋๋ค. ๋์์ ์ดํดํ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํ์ธ์.</p>",+ "<p>While parsing the HTML body, drop comments or not. Disabled by default for obvious reasons</p>": "<p>HTML ๋ณธ๋ฌธ์ ํ์ฑํ ๋ ์ฃผ์์ ์ ์งํ ์ง ์ ํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ๊บผ์ ธ ์์ต๋๋ค.</p>",+ "<p>Globally turn off the adaptive feature in all functions, this argument takes higher\npriority over all adaptive related arguments/functions in the class.</p>": "<p>๋ชจ๋ ๋ฉ์๋์ ์ ์ํ ๊ธฐ๋ฅ์ ๋๋๋ค. ํด๋์ค์ ๋ชจ๋ ์ ์ํ ๊ด๋ จ ์ธ์์ ๋ฉ์๋๋ณด๋ค ์ฐ์ ํฉ๋๋ค.</p>",+ "<p>The storage class to be passed for adaptive functionalities, see <code>Docs</code> for more info.</p>": "<p>์ ์ํ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์ฅ์ ํด๋์ค์ ๋๋ค. ์์ธํ ๋ด์ฉ์ <code>Docs</code>๋ฅผ ์ฐธ๊ณ ํ์ธ์.</p>",+ "<p>A dictionary of <code>argument->value</code> pairs to be passed for the storage class.\nIf empty, default values will be used.</p>": "<p>์ ์ฅ์ ํด๋์ค์ ์ ๋ฌํ <code>argument->value</code> ์์ ๋์ ๋๋ฆฌ์ ๋๋ค. ๋น์ด ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Return the raw body of the current <code>Selector</code> without any processing. Useful for binary and non-HTML requests.</p>": "<p>ํ์ฌ <code>Selector</code>์ ์๋ณธ ๋ณธ๋ฌธ์ ์ฒ๋ฆฌ ์์ด ๋ฐํํฉ๋๋ค. ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ๋ HTML์ด ์๋ ์์ฒญ์ ์ ์ฉํฉ๋๋ค.</p>",+ "<p>Return the raw body of the response as bytes.</p>": "<p>์๋ต์ ์๋ณธ ๋ณธ๋ฌธ์ ๋ฐ์ดํธ๋ก ๋ฐํํฉ๋๋ค.</p>",+ "<p>Generate a CSS selector for the current element</p>": "<p>ํ์ฌ ์์์ CSS ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>A string of the generated selector.</p>": "<p>์์ฑํ ์ ํ์ ๋ฌธ์์ด์ ๋๋ค.</p>",+ "<p>Generate a complete CSS selector for the current element</p>": "<p>ํ์ฌ ์์์ ์ ์ฒด CSS ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>Generate an XPath selector for the current element</p>": "<p>ํ์ฌ ์์์ XPath ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>Generate a complete XPath selector for the current element</p>": "<p>ํ์ฌ ์์์ ์ ์ฒด XPath ์ ํ์๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>Get the tag name of the element</p>": "<p>์์์ ํ๊ทธ ์ด๋ฆ์ ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>Get text content of the element</p>": "<p>์์์ ํ ์คํธ ๋ด์ฉ์ ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>Get attributes of the element</p>": "<p>์์์ ์์ฑ์ ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>Return the inner HTML code of the element</p>": "<p>์์ ๋ด๋ถ์ HTML ์ฝ๋๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return the direct parent of the element or <code>None</code> otherwise</p>": "<p>์ง์ ์ ์ธ ๋ถ๋ชจ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return all elements under the current element in the DOM tree</p>": "<p>DOM ํธ๋ฆฌ์์ ํ์ฌ ์์ ์๋์ ๋ชจ๋ ์์๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return the children elements of the current element or empty list otherwise</p>": "<p>ํ์ฌ ์์์ ์์ ์์๋ค์ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด ๋น ๋ฆฌ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return other children of the current element's parent or empty list otherwise</p>": "<p>ํ์ฌ ์์์ ๊ฐ์ ๋ถ๋ชจ๋ฅผ ๊ฐ์ง ๋ค๋ฅธ ์์ ์์๋ค์ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด ๋น ๋ฆฌ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns a list of type <code>Selectors</code> that contains the path leading to the current element from the root.</p>": "<p>๋ฃจํธ๋ถํฐ ํ์ฌ ์์๊น์ง์ ๊ฒฝ๋ก๋ฅผ ๋ด์ <code>Selectors</code> ํ์ ๋ฆฌ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns the next element of the current element in the children of the parent or <code>None</code> otherwise.</p>": "<p>๊ฐ์ ๋ถ๋ชจ์ ์์ ์ค ํ์ฌ ์์์ ๋ค์ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns the previous element of the current element in the children of the parent or <code>None</code> otherwise.</p>": "<p>๊ฐ์ ๋ถ๋ชจ์ ์์ ์ค ํ์ฌ ์์์ ์ด์ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Convert the response content to clean Markdown.</p>": "<p>์๋ต ๋ด์ฉ์ ์ ๋ฆฌ๋ Markdown์ผ๋ก ๋ณํํฉ๋๋ค.</p>",+ "<p>Scripts, styles, and hidden/prompt-injection content are always removed before conversion, which is\nthe same cleaning the MCP server does. Requires the \"markdownify\" package (<code>pip install \"scrapling[rag]\"</code>).</p>": "<p>๋ณํ ์ ์ ์คํฌ๋ฆฝํธ, ์คํ์ผ, ์จ๊ฒจ์ง ์ฝํ ์ธ ์ ํ๋กฌํํธ ์ธ์ ์ ์ฝํ ์ธ ๋ฅผ ํญ์ ์ ๊ฑฐํฉ๋๋ค. MCP ์๋ฒ์ ๊ฐ์ ์ ๋ฆฌ ๊ณผ์ ์ ์ฌ์ฉํฉ๋๋ค. markdownify ํจํค์ง๊ฐ ํ์ํฉ๋๋ค(<code>pip install \"scrapling[rag]\"</code>).</p>",+ "<p>CSS selector to convert only the matching elements. All matches are concatenated.</p>": "<p>๋ณํํ ์์๋ฅผ ์ ํํ๋ CSS ์ ํ์์ ๋๋ค. ์ผ์นํ๋ ๋ชจ๋ ์์๋ฅผ ํฉ์นฉ๋๋ค.</p>",+ "<p>Convert only the content inside the <code><body></code> tag.</p>": "<p><code><body></code> ํ๊ทธ ์์ ๋ด์ฉ๋ง ๋ณํํฉ๋๋ค.</p>",+ "<p>Create a Request to follow a URL.</p>": "<p>URL์ ๋ฐ๋ผ๊ฐ Request๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>This is a helper method for spiders to easily follow links found in pages.</p>": "<p>์คํ์ด๋๊ฐ ํ์ด์ง์์ ์ฐพ์ ๋งํฌ๋ฅผ ์ฝ๊ฒ ๋ฐ๋ผ๊ฐ๋๋ก ๋๋ ๋ฉ์๋์ ๋๋ค.</p>",+ "<p><strong>IMPORTANT</strong>: The below arguments if left empty, the corresponding value from the previous request will be used. The only exception is <code>dont_filter</code>.</p>": "<p><strong>์ค์</strong>: ์๋ ์ธ์๋ฅผ ๋น์ ๋๋ฉด ์ด์ ์์ฒญ์ ํด๋น ๊ฐ์ ์ฌ์ฉํฉ๋๋ค. <code>dont_filter</code>๋ง ์์ธ์ ๋๋ค.</p>",+ "<p>The session kwargs of the previous request are inherited as well, except <code>method</code>, <code>params</code>, <code>data</code>, <code>json</code>, <code>files</code>, and <code>multipart</code>, so a followed link is a plain GET unless you pass them again.</p>": "<p>์ด์ ์์ฒญ์ ์ธ์ ์ธ์๋ ์์ํฉ๋๋ค. ๋จ, <code>method</code>, <code>params</code>, <code>data</code>, <code>json</code>, <code>files</code>, <code>multipart</code>๋ ์ ์ธํฉ๋๋ค. ์ด ์ธ์๋ฅผ ๋ค์ ์ ๋ฌํ์ง ์์ผ๋ฉด ๋งํฌ๋ ์ผ๋ฐ GET์ผ๋ก ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>The URL to follow (can be relative, will be joined with current URL)</p>": "<p>๋ฐ๋ผ๊ฐ URL์ ๋๋ค. ์๋ URL์ด๋ฉด ํ์ฌ URL๊ณผ ๊ฒฐํฉํฉ๋๋ค.</p>",+ "<p>The session id to use</p>": "<p>์ฌ์ฉํ ์ธ์ ID์ ๋๋ค.</p>",+ "<p>Spider callback method to use</p>": "<p>์ฌ์ฉํ ์คํ์ด๋ ์ฝ๋ฐฑ ๋ฉ์๋์ ๋๋ค.</p>",+ "<p>The priority number to use, the higher the number, the higher priority to be processed first.</p>": "<p>์ฐ์ ์์ ๊ฐ์ ๋๋ค. ๊ฐ์ด ํด์๋ก ๋จผ์ ์ฒ๋ฆฌํฉ๋๋ค.</p>",+ "<p>If this request has been done before, disable the filter to allow it again.</p>": "<p>์ด๋ฏธ ์คํํ ์์ฒญ์ ๋ค์ ํ์ฉํ๋๋ก ํํฐ๋ฅผ ๋๋๋ค.</p>",+ "<p>Additional meta data to included in the request</p>": "<p>์์ฒญ์ ํฌํจํ ์ถ๊ฐ ๋ฉํ๋ฐ์ดํฐ์ ๋๋ค.</p>",+ "<p>Enabled by default, set the current response url as referer for the new request url.</p>": "<p>๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ํ์ฌ ์๋ต URL์ ์ ์์ฒญ์ Referer๋ก ์ค์ ํฉ๋๋ค.</p>",+ "<p>Additional Request arguments</p>": "<p>์ถ๊ฐ Request ์ธ์์ ๋๋ค.</p>",+ "<p>Request object ready to be yielded</p>": "<p>yield๋ก ๋ด๋ณด๋ผ ์ ์๋ Request ๊ฐ์ฒด์ ๋๋ค.</p>",+ "<p>Get all child strings of this element, concatenated using the given separator.</p>": "<p>์์ ์๋์ ๋ชจ๋ ๋ฌธ์์ด์ ์ง์ ํ ๊ตฌ๋ถ์๋ก ํฉ์ณ ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>Strings will be concatenated using this separator.</p>": "<p>๋ฌธ์์ด์ ํฉ์น ๋ ์ฌ์ฉํ ๊ตฌ๋ถ์์ ๋๋ค.</p>",+ "<p>If True, strings will be stripped before being concatenated.</p>": "<p>True์ด๋ฉด ๋ฌธ์์ด ์ ๋์ ๊ณต๋ฐฑ์ ์ ๊ฑฐํ ๋ค ํฉ์นฉ๋๋ค.</p>",+ "<p>A tuple of all tag names you want to ignore</p>": "<p>๋ฌด์ํ ๋ชจ๋ ํ๊ทธ ์ด๋ฆ์ ํํ์ ๋๋ค.</p>",+ "<p>If enabled, elements with text-content that is empty or only whitespaces will be ignored</p>": "<p>์ผ๋ฉด ํ ์คํธ๊ฐ ๋น์ด ์๊ฑฐ๋ ๊ณต๋ฐฑ๋ง ์๋ ์์๋ฅผ ๋ฌด์ํฉ๋๋ค.</p>",+ "<p>A TextHandler</p>": "<p>TextHandler ๊ฐ์ฒด์ ๋๋ค.</p>",+ "<p>Join this Selector's url with a relative url to form an absolute full URL.</p>": "<p>์ด Selector์ URL๊ณผ ์๋ URL์ ๊ฒฐํฉํด ์ ์ฒด ์ ๋ URL์ ๋ง๋ญ๋๋ค.</p>",+ "<p>Return a prettified version of the element's inner html-code</p>": "<p>์์ ๋ด๋ถ์ HTML ์ฝ๋๋ฅผ ์ฝ๊ธฐ ์ข๊ฒ ์ ๋ฆฌํ์ฌ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Check if the element has a specific class</p>": "<p>์์์ ์ง์ ํ ํด๋์ค๊ฐ ์๋์ง ํ์ธํฉ๋๋ค.</p>",+ "<p>The class name to check for</p>": "<p>ํ์ธํ ํด๋์ค ์ด๋ฆ์ ๋๋ค.</p>",+ "<p>True if element has class with that name otherwise False</p>": "<p>ํด๋น ์ด๋ฆ์ ํด๋์ค๊ฐ ์์ผ๋ฉด True, ์์ผ๋ฉด False์ ๋๋ค.</p>",+ "<p>Return a generator that loops over all ancestors of the element, starting with the element's parent.</p>": "<p>๋ถ๋ชจ๋ถํฐ ์์ํด ์์์ ๋ชจ๋ ์กฐ์์ ์ํํ๋ ์ ๋๋ ์ดํฐ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Loop over all ancestors of the element till one match the passed function</p>": "<p>์ ๋ฌํ ํจ์์ ์กฐ๊ฑด์ ๋ง๋ ์์๋ฅผ ์ฐพ์ ๋๊น์ง ์กฐ์ ์์๋ฅผ ์ํํฉ๋๋ค.</p>",+ "<p>A function that takes each ancestor as an argument and returns True/False</p>": "<p>๊ฐ ์กฐ์์ ์ธ์๋ก ๋ฐ๊ณ True/False๋ฅผ ๋ฐํํ๋ ํจ์์ ๋๋ค.</p>",+ "<p>The first ancestor that match the function or <code>None</code> otherwise.</p>": "<p>ํจ์์ ์กฐ๊ฑด์ ๋ง๋ ์ฒซ ์กฐ์ ์์์ ๋๋ค. ์์ผ๋ฉด <code>None</code>์ ๋๋ค.</p>",+ "<p>Serialize this element to a string.\nFor text nodes, returns the text value. For HTML elements, returns the outer HTML.</p>": "<p>์ด ์์๋ฅผ ๋ฌธ์์ด๋ก ์ง๋ ฌํํฉ๋๋ค. ํ ์คํธ ๋ ธ๋๋ ํ ์คํธ ๊ฐ์, HTML ์์๋ ์ธ๋ถ HTML์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return a single-element list containing this element's serialized string.</p>": "<p>์ด ์์๋ฅผ ์ง๋ ฌํํ ๋ฌธ์์ด ํ๋๋ฅผ ๋ด์ ๋ฆฌ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>This function will search again for the element in the page tree, used automatically on page structure change</p>": "<p>ํ์ด์ง ํธ๋ฆฌ์์ ์์๋ฅผ ๋ค์ ์ฐพ์ต๋๋ค. ํ์ด์ง ๊ตฌ์กฐ๊ฐ ๋ฐ๋๋ฉด ์๋์ผ๋ก ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>The element we want to relocate in the tree</p>": "<p>ํธ๋ฆฌ์์ ๋ค์ ์ฐพ์ ์์์ ๋๋ค.</p>",+ "<p>The minimum percentage to accept and not going lower than that. Be aware that the percentage\ncalculation depends solely on the page structure, so don't play with this number unless you must know\nwhat you are doing!</p>": "<p>์ผ์น๋ก ์ธ์ ํ ์ต์ ๋น์จ์ ๋๋ค. ๊ณ์ฐ์ ํ์ด์ง ๊ตฌ์กฐ์๋ง ์์กดํ๋ฏ๋ก ์ํฅ์ ์ดํดํ ๊ฒฝ์ฐ์๋ง ๊ฐ์ ๋ฐ๊พธ์ธ์.</p>",+ "<p>If True, the return result will be converted to <code>Selectors</code> object</p>": "<p>True์ด๋ฉด ๊ฒฐ๊ณผ๋ฅผ <code>Selectors</code> ๊ฐ์ฒด๋ก ๋ณํํฉ๋๋ค.</p>",+ "<p>List of pure HTML elements that got the highest matching score or 'Selectors' object</p>": "<p>์ผ์น ์ ์๊ฐ ๊ฐ์ฅ ๋์ ์๋ณธ HTML ์์ ๋ชฉ๋ก ๋๋ 'Selectors' ๊ฐ์ฒด์ ๋๋ค.</p>",+ "<p>Search the current tree with CSS3 selectors</p>": "<p>CSS3 ์ ํ์๋ก ํ์ฌ ํธ๋ฆฌ๋ฅผ ๊ฒ์ํฉ๋๋ค.</p>",+ "<p><strong>Important:\nIt's recommended to use the identifier argument if you plan to use a different selector later\nand want to relocate the same element(s)</strong></p>": "<p><strong>์ค์: ๋์ค์ ๋ค๋ฅธ ์ ํ์๋ก ๊ฐ์ ์์๋ฅผ ๋ค์ ์ฐพ์ผ๋ ค๋ฉด identifier ์ธ์๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.</strong></p>",+ "<p>The CSS3 selector to be used.</p>": "<p>์ฌ์ฉํ CSS3 ์ ํ์์ ๋๋ค.</p>",+ "<p>Enabled will make the function try to relocate the element if it was 'saved' before</p>": "<p>์ผ๋ฉด ์ด์ ์ ์ ์ฅํ ์์๋ฅผ ๋ค์ ์ฐพ์ผ๋ ค๊ณ ์๋ํฉ๋๋ค.</p>",+ "<p>A string that will be used to save/retrieve element's data in adaptive,\notherwise the selector will be used.</p>": "<p>์ ์ํ ๊ธฐ๋ฅ์์ ์์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๊ฑฐ๋ ๊ฐ์ ธ์ฌ ๋ ์ธ ๋ฌธ์์ด์ ๋๋ค. ์ง์ ํ์ง ์์ผ๋ฉด ์ ํ์๋ฅผ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Automatically save new elements for <code>adaptive</code> later</p>": "<p>๋์ค์ <code>adaptive</code>์์ ์ธ ์ ์๋๋ก ์ ์์๋ฅผ ์๋์ผ๋ก ์ ์ฅํฉ๋๋ค.</p>",+ "<p>The minimum percentage to accept while <code>adaptive</code> is working and not going lower than that.\nBe aware that the percentage calculation depends solely on the page structure, so don't play with this\nnumber unless you must know what you are doing!</p>": "<p><code>adaptive</code>๊ฐ ๋์ํ ๋ ์ผ์น๋ก ์ธ์ ํ ์ต์ ๋น์จ์ ๋๋ค. ๊ณ์ฐ์ ํ์ด์ง ๊ตฌ์กฐ์๋ง ์์กดํ๋ฏ๋ก ์ํฅ์ ์ดํดํ ๊ฒฝ์ฐ์๋ง ๊ฐ์ ๋ฐ๊พธ์ธ์.</p>",+ "<p><code>Selectors</code> class.</p>": "<p><code>Selectors</code> ํด๋์ค์ ๋๋ค.</p>",+ "<p>Search the current tree with XPath selectors</p>": "<p>XPath ์ ํ์๋ก ํ์ฌ ํธ๋ฆฌ๋ฅผ ๊ฒ์ํฉ๋๋ค.</p>",+ "<p>Note: <strong>Additional keyword arguments will be passed as XPath variables in the XPath expression!</strong></p>": "<p>์ฐธ๊ณ : <strong>์ถ๊ฐ ํค์๋ ์ธ์๋ XPath ํํ์์ ๋ณ์๋ก ์ ๋ฌํฉ๋๋ค.</strong></p>",+ "<p>The XPath selector to be used.</p>": "<p>์ฌ์ฉํ XPath ์ ํ์์ ๋๋ค.</p>",+ "<p>Find elements by filters of your creations for ease.</p>": "<p>์ง์ ๋ง๋ ํํฐ๋ก ์์๋ฅผ ์ฐพ์ต๋๋ค.</p>",+ "<p>Tag name(s), iterable of tag names, regex patterns, function, or a dictionary of elements' attributes. Leave empty for selecting all.</p>": "<p>ํ๊ทธ ์ด๋ฆ, ํ๊ทธ ์ด๋ฆ์ ๋ด์ ๋ฐ๋ณต ๊ฐ๋ฅํ ๊ฐ์ฒด, ์ ๊ท ํํ์, ํจ์ ๋๋ ์์ ์์ฑ์ ๋์ ๋๋ฆฌ์ ๋๋ค. ๋น์ ๋๋ฉด ๋ชจ๋ ์ ํํฉ๋๋ค.</p>",+ "<p>The attributes you want to filter elements based on it.</p>": "<p>์์๋ฅผ ํํฐ๋งํ ๊ธฐ์ค ์์ฑ์ ๋๋ค.</p>",+ "<p>The <code>Selectors</code> object of the elements or empty list</p>": "<p>์์๋ฅผ ๋ด์ <code>Selectors</code> ๊ฐ์ฒด ๋๋ ๋น ๋ฆฌ์คํธ์ ๋๋ค.</p>",+ "<p>Find elements by filters of your creations for ease, then return the first result. Otherwise return <code>None</code>.</p>": "<p>์ง์ ๋ง๋ ํํฐ๋ก ์์๋ฅผ ์ฐพ์ ์ฒซ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>The <code>Selector</code> object of the element or <code>None</code> if the result didn't match</p>": "<p>์์์ <code>Selector</code> ๊ฐ์ฒด์ ๋๋ค. ์ผ์นํ๋ ๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด <code>None</code>์ ๋๋ค.</p>",+ "<p>Saves the element's unique properties to the storage for retrieval and relocation later</p>": "<p>์์์ ๊ณ ์ ํ ์์ฑ์ ์ ์ฅ์์ ์ ์ฅํด ๋์ค์ ๊ฐ์ ธ์ค๊ณ ์์๋ฅผ ๋ค์ ์ฐพ์ ์ ์๊ฒ ํฉ๋๋ค.</p>",+ "<p>The element itself that we want to save to storage, it can be a <code>Selector</code> or pure <code>HtmlElement</code></p>": "<p>์ ์ฅํ ์์ ์์ฒด์ ๋๋ค. <code>Selector</code> ๋๋ ์๋ณธ <code>HtmlElement</code>๋ฅผ ์ ๋ฌํ ์ ์์ต๋๋ค.</p>",+ "<p>This is the identifier that will be used to retrieve the element later from the storage. See\nthe docs for more info.</p>": "<p>๋์ค์ ์ ์ฅ์์์ ์์๋ฅผ ๊ฐ์ ธ์ฌ ๋ ์ฌ์ฉํ ์๋ณ์์ ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.</p>",+ "<p>Using the identifier, we search the storage and return the unique properties of the element</p>": "<p>์๋ณ์๋ก ์ ์ฅ์๋ฅผ ๊ฒ์ํ๊ณ ์์์ ๊ณ ์ ํ ์์ฑ์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>This is the identifier that will be used to retrieve the element from the storage. See\nthe docs for more info.</p>": "<p>์ ์ฅ์์์ ์์๋ฅผ ๊ฐ์ ธ์ฌ ๋ ์ฌ์ฉํ ์๋ณ์์ ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.</p>",+ "<p>A dictionary of the unique properties</p>": "<p>๊ณ ์ ํ ์์ฑ์ ๋ด์ ๋์ ๋๋ฆฌ์ ๋๋ค.</p>",+ "<p>Return JSON response if the response is jsonable otherwise throws error</p>": "<p>์๋ต์ JSON์ผ๋ก ํ์ฑํ ์ ์์ผ๋ฉด ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํ๊ณ , ์๋๋ฉด ์ค๋ฅ๋ฅผ ๋ฐ์์ํต๋๋ค.</p>",+ "<p>Apply the given regex to the current text and return a list of strings with the matches.</p>": "<p>ํ์ฌ ํ ์คํธ์ ์ ๊ท ํํ์์ ์ ์ฉํ๊ณ ์ผ์นํ ๋ฌธ์์ด ๋ชฉ๋ก์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Can be either a compiled regular expression or a string.</p>": "<p>์ปดํ์ผํ ์ ๊ท ํํ์ ๋๋ ๋ฌธ์์ด์ ๋๋ค.</p>",+ "<p>If enabled character entity references are replaced by their corresponding character</p>": "<p>์ผ๋ฉด ๋ฌธ์ ์ฐธ์กฐ๋ฅผ ํด๋น ๋ฌธ์๋ก ๋ฐ๊ฟ๋๋ค.</p>",+ "<p>if enabled, this will ignore all whitespaces and consecutive spaces while matching</p>": "<p>์ผ๋ฉด ์ผ์น ์ฌ๋ถ๋ฅผ ๊ฒ์ฌํ ๋ ๊ณต๋ฐฑ ๋ฌธ์์ ์ฐ์๋ ๊ณต๋ฐฑ์ ๋ฌด์ํฉ๋๋ค.</p>",+ "<p>if disabled, the function will set the regex to ignore the letters case while compiling it</p>": "<p>๋๋ฉด ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์๋๋ก ์ ๊ท ํํ์์ ์ปดํ์ผํฉ๋๋ค.</p>",+ "<p>Apply the given regex to text and return the first match if found, otherwise return the default value.</p>": "<p>ํ ์คํธ์ ์ ๊ท ํํ์์ ์ ์ฉํ๊ณ ์ฒซ ์ผ์น๋ฅผ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>The default value to be returned if there is no match</p>": "<p>์ผ์นํ๋ ๊ฒฐ๊ณผ๊ฐ ์์ ๋ ๋ฐํํ ๊ธฐ๋ณธ๊ฐ์ ๋๋ค.</p>",+ "<p>\n <span class=\"doc-param-default\">\n <b>DEFAULT:</b>\n <code>None</code>\n </span>\n </p>": "<p>\n <span class=\"doc-param-default\">\n <b>๊ธฐ๋ณธ๊ฐ:</b>\n <code>None</code>\n </span>\n </p>",+ "<p>if enabled character entity references are replaced by their corresponding character</p>": "<p>์ผ๋ฉด ๋ฌธ์ ์ฐธ์กฐ๋ฅผ ํด๋น ๋ฌธ์๋ก ๋ฐ๊ฟ๋๋ค.</p>",+ "<p>Find elements that are in the same tree depth in the page with the same tag name and same parent tag etc...\nthen return the ones that match the current element attributes with a percentage higher than the input threshold.</p>": "<p>ํ์ด์ง์์ ๊น์ด, ํ๊ทธ ์ด๋ฆ, ๋ถ๋ชจ ํ๊ทธ ๋ฑ์ด ๊ฐ์ ์์๋ฅผ ์ฐพ์ต๋๋ค. ๊ทธ์ค ํ์ฌ ์์์์ ์์ฑ ์ผ์น์จ์ด ์ง์ ํ ๊ธฐ์ค๋ณด๋ค ๋์ ์์๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>This function is inspired by AutoScraper and made for cases where you, for example, found a product div inside\na products-list container and want to find other products using that element as a starting point EXCEPT\nthis function works in any case without depending on the element type.</p>": "<p>AutoScraper์์ ์์ด๋์ด๋ฅผ ์ป์ ํจ์์ ๋๋ค. ์๋ฅผ ๋ค์ด ์ํ ๋ชฉ๋ก ์์์ ์ํ div ํ๋๋ฅผ ์ฐพ์๋ค๋ฉด ์ด๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ค๋ฅธ ์ํ์ ์ฐพ์ ์ ์์ต๋๋ค. ์ด ํจ์๋ ์์ ์ข ๋ฅ์ ์์กดํ์ง ์์ผ๋ฏ๋ก ๋ค๋ฅธ ์ํฉ์์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>The percentage to use while comparing element attributes.\nNote: Elements found before attributes matching/comparison will be sharing the same depth, same tag name,\nsame parent tag name, and same grand parent tag name. So they are 99% likely to be correct unless you are\nextremely unlucky, then attributes matching comes into play, so don't play with this number unless\nyou are getting the results you don't want.\nAlso, if the current element doesn't have attributes and the similar element as well, then it's a 100% match.</p>": "<p>์์์ ์์ฑ์ ๋น๊ตํ ๋ ์ฌ์ฉํ ๋น์จ์ ๋๋ค. ์์ฑ ๋น๊ต ์ ์๋ ์ ํํ ์์๋ค์ ๊น์ด, ํ๊ทธ ์ด๋ฆ, ๋ถ๋ชจ ํ๊ทธ ์ด๋ฆ, ๋ถ๋ชจ์ ๋ถ๋ชจ ํ๊ทธ ์ด๋ฆ์ด ๊ฐ์ต๋๋ค. ๋ฐ๋ผ์ ๋งค์ฐ ๋๋ฌธ ๊ฒฝ์ฐ๋ฅผ ์ ์ธํ๋ฉด 99% ํ๋ฅ ๋ก ์ฌ๋ฐ๋ฅธ ์์์ ๋๋ค. ์ดํ ์์ฑ์ ๋น๊ตํ๋ฏ๋ก ์ํ์ง ์๋ ๊ฒฐ๊ณผ๊ฐ ๋์ฌ ๋๋ง ์ด ๊ฐ์ ๋ฐ๊พธ์ธ์. ํ์ฌ ์์์ ๋น์ทํ ์์ ๋ชจ๋ ์์ฑ์ด ์์ผ๋ฉด 100% ์ผ์น๋ก ๋ด ๋๋ค.</p>",+ "<p>Attribute names passed will be ignored while matching the attributes in the last step.\nThe default value is to ignore <code>href</code> and <code>src</code> as URLs can change a lot between elements, so it's unreliable</p>": "<p>๋ง์ง๋ง ์์ฑ ๋น๊ต์์ ๋ฌด์ํ ์์ฑ ์ด๋ฆ์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก <code>href</code>์ <code>src</code>๋ฅผ ๋ฌด์ํฉ๋๋ค. URL์ ์์๋ง๋ค ํฌ๊ฒ ๋ฌ๋ผ์ง ์ ์์ด ๋น๊ต ๊ธฐ์ค์ผ๋ก ๋ฏฟ๊ธฐ ์ด๋ ต๊ธฐ ๋๋ฌธ์ ๋๋ค.</p>",+ "<p>If True, element text content will be taken into calculation while matching.\nNot recommended to use in normal cases, but it depends.</p>": "<p>True์ด๋ฉด ์์์ ํ ์คํธ ๋ด์ฉ๋ ๋น๊ต์ ์ฌ์ฉํฉ๋๋ค. ์ผ๋ฐ์ ์ผ๋ก ๊ถ์ฅํ์ง ์์ง๋ง ์ํฉ์ ๋ฐ๋ผ ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>A <code>Selectors</code> container of <code>Selector</code> objects or empty list</p>": "<p><code>Selectors</code> ์ปจํ ์ด๋์ <code>Selector</code> ๊ฐ์ฒด๋ค์ ๋ด์ ๋ฐํํฉ๋๋ค. ๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด ๋น ๋ฆฌ์คํธ์ ๋๋ค.</p>",+ "<p>Find elements that its text content fully/partially matches input.</p>": "<p>ํ ์คํธ ๋ด์ฉ์ด ์ ๋ ฅ๊ณผ ์์ ํ ๋๋ ๋ถ๋ถ์ ์ผ๋ก ์ผ์นํ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.</p>",+ "<p>Text query to match</p>": "<p>์ผ์น ์ฌ๋ถ๋ฅผ ํ์ธํ ๊ฒ์ ํ ์คํธ์ ๋๋ค.</p>",+ "<p>Returns the first element that matches conditions, enabled by default</p>": "<p>์กฐ๊ฑด์ ๋ง๋ ์ฒซ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.</p>",+ "<p>If enabled, the function returns elements that contain the input text</p>": "<p>์ผ๋ฉด ์ ๋ ฅํ ํ ์คํธ๋ฅผ ํฌํจํ๋ ์์๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>if enabled, the letters case will be taken into consideration</p>": "<p>์ผ๋ฉด ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํฉ๋๋ค.</p>",+ "<p>Find elements that its text content matches the input regex pattern.</p>": "<p>ํ ์คํธ๊ฐ ์ง์ ํ ์ ๊ท์๊ณผ ์ผ์นํ๋ ์์๋ฅผ ์ฐพ์ต๋๋ค.</p>",+ "<p>Regex query/pattern to match</p>": "<p>์ผ์น ์ฌ๋ถ๋ฅผ ํ์ธํ ์ ๊ท์์ ๋๋ค.</p>",+ "<p>Return the first element that matches conditions; enabled by default.</p>": "<p>์กฐ๊ฑด์ ๋ง๋ ์ฒซ ๋ฒ์งธ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.</p>",+ "<p>If enabled, the letters case will be taken into consideration in the regex.</p>": "<p>์ผ๋ฉด ์ ๊ท์์์ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํฉ๋๋ค.</p>",+ "<p>If enabled, this will ignore all whitespaces and consecutive spaces while matching.</p>": "<p>์ผ๋ฉด ์ผ์น ์ฌ๋ถ๋ฅผ ํ์ธํ ๋ ๊ณต๋ฐฑ ๋ฌธ์์ ์ฐ์ ๊ณต๋ฐฑ์ ๋ฌด์ํฉ๋๋ค.</p>",+ "<p>A basic <code>Fetcher</code> class type that can only do basic GET, POST, PUT, and DELETE HTTP requests based on <code>curl_cffi</code>.</p>": "<p>๊ธฐ๋ณธ <code>Fetcher</code> ํด๋์ค์ ๋๋ค. <code>curl_cffi</code>๋ฅผ ์ฌ์ฉํด ๊ธฐ๋ณธ์ ์ธ GET, POST, PUT, DELETE HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค.</p>",+ "<p>Set multiple arguments for the parser at once globally</p>": "<p>ํ์์ ์ฌ๋ฌ ๊ณตํต ์ค์ ์ ํ ๋ฒ์ ์ง์ ํฉ๋๋ค.</p>",+ "<p>The keywords can be any arguments of the following: huge_tree, keep_comments, adaptive, storage, storage_args, adaptive_domain</p>": "<p>์ฌ์ฉํ ์ ์๋ ํค์๋ ์ธ์๋ huge_tree, keep_comments, adaptive, storage, storage_args, adaptive_domain์ ๋๋ค.</p>",+ "<p>\n <span class=\"doc-param-default\">\n <b>DEFAULT:</b>\n <code>{}</code>\n </span>\n </p>": "<p>\n <span class=\"doc-param-default\">\n <b>๊ธฐ๋ณธ๊ฐ:</b>\n <code>{}</code>\n </span>\n </p>",+ "<p>A <code>Fetcher</code> class type which is a completely stealthy built on top of Chromium.</p>": "<p>Chromium์ ๊ธฐ๋ฐ์ผ๋ก ์์ ํ ์คํ ์ค ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ <code>Fetcher</code> ํด๋์ค์ ๋๋ค.</p>",+ "<p>It works as real browsers passing almost all online tests/protections with many customization options.</p>": "<p>์ค์ ๋ธ๋ผ์ฐ์ ์ฒ๋ผ ๋์ํด ๊ฑฐ์ ๋ชจ๋ ์จ๋ผ์ธ ํ ์คํธ์ ๋ณดํธ ๊ธฐ๋ฅ์ ํต๊ณผํ๋ฉฐ ๋ค์ํ ์ค์ ์ ์ ๊ณตํฉ๋๋ค.</p>",+ "<p>Opens up a browser and do your request based on your chosen options below.</p>": "<p>๋ธ๋ผ์ฐ์ ๋ฅผ ์ด๊ณ ์๋์์ ์ ํํ ์ค์ ์ ๋ฐ๋ผ ์์ฒญ์ ์คํํฉ๋๋ค.</p>",+ "<p>Target url.</p>": "<p>๋์ URL์ ๋๋ค.</p>",+ "<p>Run the browser in headless/hidden (default), or headful/visible mode.</p>": "<p>๋ธ๋ผ์ฐ์ ๋ฅผ ์ฐฝ ์๋ ๋ชจ๋(๊ธฐ๋ณธ๊ฐ) ๋๋ ์ฐฝ์ ํ์ํ๋ ๋ชจ๋๋ก ์คํํฉ๋๋ค.</p>",+ "<p>Drop requests for unnecessary resources for a speed boost.\nRequests dropped are of type <code>font</code>, <code>image</code>, <code>media</code>, <code>beacon</code>, <code>object</code>, <code>imageset</code>, <code>texttrack</code>, <code>websocket</code>, <code>csp_report</code>, and <code>stylesheet</code>.</p>": "<p>๋ถํ์ํ ๋ฆฌ์์ค ์์ฒญ์ ๊ฑด๋๋ฐ์ด ์๋๋ฅผ ๋์ ๋๋ค. ๋์ ํ์ ์ <code>font</code>, <code>image</code>, <code>media</code>, <code>beacon</code>, <code>object</code>, <code>imageset</code>, <code>texttrack</code>, <code>websocket</code>, <code>csp_report</code>, <code>stylesheet</code>์ ๋๋ค.</p>",+ "<p>A set of domain names to block requests to. Subdomains are also matched (e.g., <code>\"example.com\"</code> blocks <code>\"sub.example.com\"</code> too).</p>": "<p>์์ฒญ์ ์ฐจ๋จํ ๋๋ฉ์ธ ์ด๋ฆ์ ์งํฉ์ ๋๋ค. ํ์ ๋๋ฉ์ธ๋ ์ผ์นํฉ๋๋ค. ์๋ฅผ ๋ค์ด <code>\"example.com\"</code>์ <code>\"sub.example.com\"</code>๋ ์ฐจ๋จํฉ๋๋ค.</p>",+ "<p>Block requests to ~3,500 known ad/tracking domains. Can be combined with <code>blocked_domains</code>.</p>": "<p>์๋ ค์ง ๊ด๊ณ ๋ฐ ์ถ์ ๋๋ฉ์ธ ์ฝ 3,500๊ฐ์ ๋ํ ์์ฒญ์ ์ฐจ๋จํฉ๋๋ค. <code>blocked_domains</code>์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>Route DNS queries through Cloudflare's DNS-over-HTTPS to prevent DNS leaks when using proxies.</p>": "<p>DNS ์ฟผ๋ฆฌ๋ฅผ Cloudflare DNS-over-HTTPS๋ก ๋ณด๋ด ํ๋ก์ ์ฌ์ฉ ์ DNS ์ ์ถ์ ๋ง์ต๋๋ค.</p>",+ "<p>Pass a useragent string to be used. Otherwise the fetcher will generate a real Useragent of the same browser and use it.</p>": "<p>์ฌ์ฉํ User-Agent ๋ฌธ์์ด์ ๋๋ค. ์๋ตํ๋ฉด Fetcher๊ฐ ๊ฐ์ ๋ธ๋ผ์ฐ์ ์ ์ค์ User-Agent๋ฅผ ์์ฑํด ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Set cookies for the next request.</p>": "<p>๋ค์ ์์ฒญ์ ์ฌ์ฉํ ์ฟ ํค๋ฅผ ์ค์ ํฉ๋๋ค.</p>",+ "<p>Wait for the page until there are no network connections for at least 500 ms.</p>": "<p>ํ์ด์ง์์ ์ต์ 500๋ฐ๋ฆฌ์ด ๋์ ๋คํธ์ํฌ ์ฐ๊ฒฐ์ด ์์ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.</p>",+ "<p>The timeout in milliseconds that is used in all operations and waits through the page. The default is 30,000</p>": "<p>ํ์ด์ง์ ๋ชจ๋ ์์ ๊ณผ ๋๊ธฐ์ ์ฌ์ฉํ๋ ๋ฐ๋ฆฌ์ด ๋จ์ ์ ํ ์๊ฐ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 30,000์ ๋๋ค.</p>",+ "<p>The time (milliseconds) the fetcher will wait after everything finishes before closing the page and returning the <code>Response</code> object.</p>": "<p>๋ชจ๋ ์ฒ๋ฆฌ๊ฐ ๋๋ ๋ค ํ์ด์ง๋ฅผ ๋ซ๊ณ <code>Response</code>๋ฅผ ๋ฐํํ๊ธฐ ์ ์ ๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ์ ๋๋ค. ๋จ์๋ ๋ฐ๋ฆฌ์ด์ ๋๋ค.</p>",+ "<p>Added for automation. A function that takes the <code>page</code> object, runs after navigation, and does the automation you need.</p>": "<p>์๋ํ์ฉ ํจ์์ ๋๋ค. <code>page</code> ๊ฐ์ฒด๋ฅผ ๋ฐ๊ณ ํ์ด์ง ์ด๋ ํ ํ์ํ ์์ ์ ์คํํฉ๋๋ค.</p>",+ "<p>A function that takes the <code>page</code> object, runs before navigation. Use it to register event listeners or routes that must be set up before the page loads.</p>": "<p><code>page</code> ๊ฐ์ฒด๋ฅผ ๋ฐ๊ณ ํ์ด์ง ์ด๋ ์ ์ ์คํ๋๋ ํจ์์ ๋๋ค. ํ์ด์ง ๋ก๋ ์ ์ ํ์ํ ์ด๋ฒคํธ ๋ฆฌ์ค๋๋ ๋ผ์ฐํธ๋ฅผ ๋ฑ๋กํ ๋ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Wait for a specific CSS selector to be in a specific state.</p>": "<p>์ง์ ํ CSS ์ ํ์์ ์์๊ฐ ํน์ ์ํ๊ฐ ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.</p>",+ "<p>An absolute path to a JavaScript file to be executed on page creation for all pages in this session.</p>": "<p>์ด ์ธ์ ์ ๊ฐ ํ์ด์ง๊ฐ ์์ฑ๋ ๋ ์คํํ JavaScript ํ์ผ์ ์ ๋ ๊ฒฝ๋ก์ ๋๋ค.</p>",+ "<p>Specify user locale, for example, <code>en-GB</code>, <code>de-DE</code>, etc. Locale will affect navigator.language value, Accept-Language request header value as well as number and date formatting\nrules. Defaults to the system default locale.</p>": "<p><code>en-GB</code>, <code>de-DE</code> ๊ฐ์ ๋ก์บ์ ์ง์ ํฉ๋๋ค. navigator.language, ์์ฒญ์ Accept-Language ํค๋, ์ซ์์ ๋ ์ง ํ์ ํ์์ ์ํฅ์ ์ค๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ์์คํ ๋ก์บ์ ๋๋ค.</p>",+ "<p>Changes the timezone of the browser. Defaults to the system timezone.</p>": "<p>๋ธ๋ผ์ฐ์ ์ ์๊ฐ๋๋ฅผ ๋ฐ๊ฟ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ์์คํ ์๊ฐ๋์ ๋๋ค.</p>",+ "<p>The state to wait for the selector given with <code>wait_selector</code>. The default state is <code>attached</code>.</p>": "<p><code>wait_selector</code>๋ก ์ง์ ํ ์์์ ๋ํด ๊ธฐ๋ค๋ฆด ์ํ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ <code>attached</code>์ ๋๋ค.</p>",+ "<p>Solves all types of the Cloudflare's Turnstile/Interstitial challenges before returning the response to you.</p>": "<p>๋ชจ๋ ์ข ๋ฅ์ Cloudflare Turnstile/Interstitial ๊ฒ์ฌ๋ฅผ ํต๊ณผํ ๋ค ์๋ต์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>If you have a Chrome browser installed on your device, enable this, and the Fetcher will launch an instance of your browser and use it.</p>": "<p>๊ธฐ๊ธฐ์ Chrome์ด ์ค์น๋์ด ์๋ค๋ฉด ์ด ์ต์ ์ ์ผ์ธ์. Fetcher๊ฐ ํด๋น ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํด ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Add random noise to canvas operations to prevent fingerprinting.</p>": "<p>Canvas ์์ ์ ๋ฌด์์ ๋ ธ์ด์ฆ๋ฅผ ์ถ๊ฐํด ์ง๋ฌธ ์์ง์ ๋ง์ต๋๋ค.</p>",+ "<p>Forces WebRTC to respect proxy settings to prevent local IP address leak.</p>": "<p>WebRTC์ ํ๋ก์ ์ค์ ์ ์ ์ฉํด ๋ก์ปฌ IP ์ฃผ์ ์ ์ถ์ ๋ง์ต๋๋ค.</p>",+ "<p>Enabled by default. Disabling it disables WebGL and WebGL 2.0 support entirely. Disabling WebGL is not recommended as many WAFs now check if WebGL is enabled.</p>": "<p>๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ๋๋ฉด WebGL๊ณผ WebGL 2.0์ ๋ชจ๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋ง์ WAF๊ฐ WebGL ํ์ฑํ ์ฌ๋ถ๋ฅผ ํ์ธํ๋ฏ๋ก ๋๋ ๊ฒ์ ๊ถ์ฅํ์ง ์์ต๋๋ค.</p>",+ "<p>Enabled by default, wait for all JavaScript on page(s) to fully load and execute.</p>": "<p>๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. ํ์ด์ง์ ๋ชจ๋ JavaScript๊ฐ ๋ก๋๋๊ณ ์คํ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.</p>",+ "<p>Include open Shadow DOM content in the response HTML. Defaults to False.</p>": "<p>open ๋ชจ๋์ Shadow DOM ๋ด์ฉ์ ์๋ต HTML์ ํฌํจํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ False์ ๋๋ค.</p>",+ "<p>Instead of launching a new browser instance, connect to this CDP URL to control real browsers through CDP.</p>": "<p>์ ๋ธ๋ผ์ฐ์ ๋ฅผ ์คํํ๋ ๋์ ์ด CDP URL์ ์ฐ๊ฒฐํด ๋ธ๋ผ์ฐ์ ๋ฅผ ์ ์ดํฉ๋๋ค.</p>",+ "<p>Enabled by default, Scrapling will set a Google referer header.</p>": "<p>๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค. Scrapling์ด Google Referer ํค๋๋ฅผ ์ค์ ํฉ๋๋ค.</p>",+ "<p>A dictionary of extra headers to add to the request. <em>The referer set by <code>google_search</code> takes priority over the referer set here if used together.</em></p>": "<p>์์ฒญ์ ์ถ๊ฐํ ํค๋์ ๋์ ๋๋ฆฌ์ ๋๋ค. <em><code>google_search</code>์ ํจ๊ป ์ฌ์ฉํ๋ฉด ํด๋น ์ต์ ์ Referer๊ฐ ์ฌ๊ธฐ์ ์ค์ ํ Referer๋ณด๋ค ์ฐ์ ํฉ๋๋ค.</em></p>",+ "<p>The proxy to be used with requests, it can be a string or a dictionary with the keys 'server', 'username', and 'password' only.</p>": "<p>์์ฒญ์ ์ฌ์ฉํ ํ๋ก์์ ๋๋ค. ๋ฌธ์์ด ๋๋ 'server', 'username', 'password' ํค๋ง ์๋ ๋์ ๋๋ฆฌ๋ฅผ ๋ฐ์ต๋๋ค.</p>",+ "<p>Path to a User Data Directory, which stores browser session data like cookies and local storage. The default is to create a temporary directory.</p>": "<p>์ฟ ํค์ ๋ก์ปฌ ์คํ ๋ฆฌ์ง ๊ฐ์ ๋ธ๋ผ์ฐ์ ์ธ์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ์ฌ์ฉ์ ๋ฐ์ดํฐ ๋๋ ํฐ๋ฆฌ์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์์ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>A list of additional browser flags to pass to the browser on launch.</p>": "<p>๋ธ๋ผ์ฐ์ ์์ ์ ์ ๋ฌํ ์ถ๊ฐ ํ๋๊ทธ ๋ฆฌ์คํธ์ ๋๋ค.</p>",+ "<p>The arguments that will be passed in the end while creating the final Selector's class.</p>": "<p>์ต์ข Selector ๊ฐ์ฒด๋ฅผ ๋ง๋ค ๋ ์ ๋ฌํ ์ธ์์ ๋๋ค.</p>",+ "<p>Additional arguments to be passed to Playwright's context as additional settings, and it takes higher priority than Scrapling's settings.</p>": "<p>Playwright ์ปจํ ์คํธ์ ์ ๋ฌํ ์ถ๊ฐ ์ค์ ์ ๋๋ค. Scrapling์ ์ค์ ๋ณด๋ค ์ฐ์ ํฉ๋๋ค.</p>",+ "<p>A <code>Response</code> object.</p>": "<p><code>Response</code> ๊ฐ์ฒด์ ๋๋ค.</p>",+ "<p>A factory context manager that provides configured Fetcher sessions.</p>": "<p>์ค์ ๋ Fetcher ์ธ์ ์ ๋ง๋๋ ์ปจํ ์คํธ ๊ด๋ฆฌ์์ ๋๋ค.</p>",+ "<p>When this manager is used in a 'with' or 'async with' block,\nit yields a new session configured with the manager's defaults.\nA single instance of this manager should ideally be used for one active\nsession at a time (or sequentially). Re-entering a context with the\nsame manager instance while a session is already active is disallowed.</p>": "<p>์ด ๊ด๋ฆฌ์๋ฅผ 'with' ๋๋ 'async with' ๋ธ๋ก์์ ์ฌ์ฉํ๋ฉด ๊ด๋ฆฌ์์ ๊ธฐ๋ณธ ์ค์ ์ผ๋ก ์ ์ธ์ ์ ๋ง๋ญ๋๋ค. ํ๋์ ๊ด๋ฆฌ์์์๋ ํ ๋ฒ์ ํ๋์ ์ธ์ ์ ์ฌ์ฉํ๊ฑฐ๋ ์ฌ๋ฌ ์ธ์ ์ ์์๋๋ก ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ธ์ ์ด ํ์ฑํ๋ ๋์ ๊ฐ์ ๊ด๋ฆฌ์๋ก ์ปจํ ์คํธ์ ๋ค์ ๋ค์ด๊ฐ ์๋ ์์ต๋๋ค.</p>",+ "<p>Browser version to impersonate. Can be a single browser string or a list of browser strings for random selection. (Default: latest available Chrome version)</p>": "<p>๋ชจ๋ฐฉํ ๋ธ๋ผ์ฐ์ ๋ฒ์ ์ ๋๋ค. ๋ธ๋ผ์ฐ์ ๋ฌธ์์ด ํ๋ ๋๋ ๋ฌด์์ ์ ํ์ ์ํ ๋ฌธ์์ด ๋ฆฌ์คํธ๋ฅผ ๋ฐ์ต๋๋ค. ๊ธฐ๋ณธ๊ฐ์ ์ฌ์ฉ ๊ฐ๋ฅํ ์ต์ Chrome ๋ฒ์ ์ ๋๋ค.</p>",+ "<p>Whether to use HTTP3. Defaults to False. It might be problematic if used it with <code>impersonate</code>.</p>": "<p>HTTP3์ ์ฌ์ฉํ ์ง ์ ํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ False์ ๋๋ค. <code>impersonate</code>์ ํจ๊ป ์ฌ์ฉํ๋ฉด ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์์ต๋๋ค.</p>",+ "<p>If enabled (default), it creates and adds real browser headers. It also sets a Google referer header.</p>": "<p>์ผ๋ฉด ์ค์ ๋ธ๋ผ์ฐ์ ์ ํค๋๋ฅผ ์์ฑํด ์ถ๊ฐํฉ๋๋ค. Google Referer ํค๋๋ ์ค์ ํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์ผ์ ธ ์์ต๋๋ค.</p>",+ "<p>Dict of proxies to use. Format: {\"http\": proxy_url, \"https\": proxy_url}.</p>": "<p>์ฌ์ฉํ ํ๋ก์ ๋์ ๋๋ฆฌ์ ๋๋ค. ํ์์ {\"http\": proxy_url, \"https\": proxy_url}์ ๋๋ค.</p>",+ "<p>Proxy URL to use. Format: \"http://username:password@localhost:8030\".\nCannot be used together with the <code>proxies</code> parameter.</p>": "<p>์ฌ์ฉํ ํ๋ก์ URL์ ๋๋ค. ํ์์ \"http://username:password@localhost:8030\"์ ๋๋ค. <code>proxies</code> ์ธ์์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>HTTP basic auth for proxy, tuple of (username, password).</p>": "<p>ํ๋ก์์ HTTP Basic ์ธ์ฆ์ ๋๋ค. (username, password) ํํ๋ก ์ ๋ฌํฉ๋๋ค.</p>",+ "<p>Number of seconds to wait before timing out.</p>": "<p>์๊ฐ์ด ์ด๊ณผ๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฌ๋ ์ด ๋จ์ ์๊ฐ์ ๋๋ค.</p>",+ "<p>Headers to include in the session with every request.</p>": "<p>์ธ์ ์ ๋ชจ๋ ์์ฒญ์ ํฌํจํ ํค๋์ ๋๋ค.</p>",+ "<p>Number of retry attempts. Defaults to 3.</p>": "<p>์ฌ์๋ ํ์์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 3์ ๋๋ค.</p>",+ "<p>Number of seconds to wait between retry attempts. Defaults to 1 second.</p>": "<p>์ฌ์๋ ์ฌ์ด์ ๊ธฐ๋ค๋ฆฌ๋ ์ด ๋จ์ ์๊ฐ์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 1์ด์ ๋๋ค.</p>",+ "<p>Whether to follow redirects. Defaults to \"safe\", which follows redirects but rejects those targeting internal/private IPs (SSRF protection). Pass True to follow all redirects without restriction.</p>": "<p>๋ฆฌ๋๋ ์ ์ ๋ฐ๋ฅผ์ง ์ ํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ธ \"safe\"๋ ๋ฆฌ๋๋ ์ ์ ๋ฐ๋ฅด๋ ๋ด๋ถ ๋๋ ์ฌ์ค IP๋ก ๊ฐ๋ ๋ฆฌ๋๋ ์ ์ ์ฐจ๋จํด SSRF๋ฅผ ๋ฐฉ์งํฉ๋๋ค. ์ ํ ์์ด ๋ชจ๋ ๋ฆฌ๋๋ ์ ์ ๋ฐ๋ฅด๋ ค๋ฉด True๋ฅผ ์ ๋ฌํ์ธ์.</p>",+ "<p>Maximum number of redirects. Default 30, use -1 for unlimited.</p>": "<p>์ต๋ ๋ฆฌ๋๋ ์ ํ์์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 30์ด๋ฉฐ, -1์ ์ ํ์ ์์ฑ๋๋ค.</p>",+ "<p>Whether to verify HTTPS certificates. Defaults to True.</p>": "<p>HTTPS ์ธ์ฆ์๋ฅผ ๊ฒ์ฆํ ์ง ์ ํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ True์ ๋๋ค.</p>",+ "<p>Tuple of (cert, key) filenames for the client certificate.</p>": "<p>ํด๋ผ์ด์ธํธ ์ธ์ฆ์ ํ์ผ ์ด๋ฆ์ (cert, key) ํํ์ ๋๋ค.</p>",+ "<p>Arguments passed when creating the final Selector class.</p>": "<p>์ต์ข Selector ๊ฐ์ฒด๋ฅผ ๋ง๋ค ๋ ์ ๋ฌํ ์ธ์์ ๋๋ค.</p>",+ "<p>A ProxyRotator instance for automatic proxy rotation.</p>": "<p>์๋ ํ๋ก์ ์ํ์ ์ฌ์ฉํ ProxyRotator ๊ฐ์ฒด์ ๋๋ค.</p>",+ "<p>Creates and returns a new synchronous Fetcher Session</p>": "<p>์ ๋๊ธฐ Fetcher ์ธ์ ์ ๋ง๋ค์ด ๋ฐํํฉ๋๋ค.</p>",+ "<p>Creates and returns a new asynchronous Session.</p>": "<p>์ ๋น๋๊ธฐ ์ธ์ ์ ๋ง๋ค์ด ๋ฐํํฉ๋๋ค.</p>",+ "<p>A Stealthy Browser session manager with page pooling.</p>": "<p>ํญ ํ์ ์ ๊ณตํ๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ๊ด๋ฆฌ์์ ๋๋ค.</p>",+ "<p>A Browser session manager with page pooling, it's using a persistent browser Context by default with a temporary user profile directory.</p>": "<p>ํญ ํ์ ์ ๊ณตํ๋ ๋ธ๋ผ์ฐ์ ์ธ์ ๊ด๋ฆฌ์์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์์ ์ฌ์ฉ์ ํ๋กํ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ ์๊ตฌ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Save completed browser requests and responses. Failed or unfinished requests are omitted. Defaults to False.</p>": "<p>์๋ฃ๋ ๋ธ๋ผ์ฐ์ ์์ฒญ๊ณผ ์๋ต์ ์ ์ฅํฉ๋๋ค. ์คํจํ๊ฑฐ๋ ๋๋์ง ์์ ์์ฒญ์ ์ ์ธํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ False์ ๋๋ค.</p>",+ "<p>Maximum retained requests per session. Defaults to 1000; older entries are removed.</p>": "<p>์ธ์ ๋ณ๋ก ๋ณด๊ดํ ์์ฒญ์ ์ต๋ ๊ฐ์์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 1,000์ด๋ฉฐ ์ค๋๋ ํญ๋ชฉ๋ถํฐ ์ ๊ฑฐํฉ๋๋ค.</p>",+ "<p>Save cookies, local storage and IndexedDB to a Playwright-compatible JSON file.</p>": "<p>์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ Playwright์ ํธํ๋๋ JSON ํ์ผ์ ์ ์ฅํฉ๋๋ค.</p>",+ "<p>Requires a started session without proxy rotation. Does not save sessionStorage.</p>": "<p>์คํ ์ค์ด๋ฉฐ ํ๋ก์ ์ํ์ ์ฌ์ฉํ์ง ์๋ ์ธ์ ์ด ํ์ํฉ๋๋ค. sessionStorage๋ ์ ์ฅํ์ง ์์ต๋๋ค.</p>",+ "<p>Replace cookies, local storage and IndexedDB from a Playwright-compatible JSON file.</p>": "<p>Playwright์ ํธํ๋๋ JSON ํ์ผ์์ ์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ ๋ถ๋ฌ์ ๊ธฐ์กด ๊ฐ์ ๋ฐ๊ฟ๋๋ค.</p>",+ "<p>Requires a started session without proxy rotation. Fetch or reload pages to use the restored login.</p>": "<p>์คํ ์ค์ด๋ฉฐ ํ๋ก์ ์ํ์ ์ฌ์ฉํ์ง ์๋ ์ธ์ ์ด ํ์ํฉ๋๋ค. ๋ณต์ํ ๋ก๊ทธ์ธ ์ํ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ฑฐ๋ ์๋ก๊ณ ์นจํ์ธ์.</p>",+ "<p>Close every open tab in the session's pool. The next request opens a fresh tab.</p>": "<p>์ธ์ ํ์ ์ด๋ฆฐ ํญ์ ๋ชจ๋ ๋ซ์ต๋๋ค. ๋ค์ ์์ฒญ์ ์ ํญ์ ์ฝ๋๋ค.</p>",+ "<p>Close all resources</p>": "<p>๋ชจ๋ ๋ฆฌ์์ค๋ฅผ ๋ซ์ต๋๋ค.</p>",+ "<p>Get statistics about the current page pool</p>": "<p>ํ์ฌ ํญ ํ์ ํต๊ณ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>Create a browser for this instance and context.</p>": "<p>์ด ์ธ์คํด์ค์ ์ปจํ ์คํธ๋ฅผ ์ํ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>Opens up the browser and do your request based on your chosen options.</p>": "<p>๋ธ๋ผ์ฐ์ ๋ฅผ ์ด๊ณ ์ ํํ ์ค์ ์ ๋ฐ๋ผ ์์ฒญ์ ์คํํฉ๋๋ค.</p>",+ "<p>The Target url.</p>": "<p>๋์ URL์ ๋๋ค.</p>",+ "<p>Static proxy to override rotator and session proxy. A new browser context will be created and used with it.</p>": "<p>์ํ ์ค์ ๊ณผ ์ธ์ ํ๋ก์๋ฅผ ๋ฎ์ด์ธ ๊ณ ์ ํ๋ก์์ ๋๋ค. ๋ณ๋์ ์ ๋ธ๋ผ์ฐ์ ์ปจํ ์คํธ๋ฅผ ๋ง๋ค์ด ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>An async Stealthy Browser session manager with page pooling.</p>": "<p>ํญ ํ์ ์ ๊ณตํ๋ ๋น๋๊ธฐ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ๊ด๋ฆฌ์์ ๋๋ค.</p>",+ "<p>A thread-safe proxy rotator with pluggable rotation strategies.</p>": "<p>์ฌ๋ฌ ์ค๋ ๋์์ ์์ ํ๊ฒ ์ฌ์ฉํ ์ ์๋ ํ๋ก์ ์ํ ๊ธฐ๋ฅ์ ๋๋ค. ์ํ ๋ฐฉ์์ ๋ฐ๊ฟ ์ ์์ต๋๋ค.</p>",+ "<p>Supports:\n- Cyclic rotation (default)\n- Custom rotation strategies via callable\n- Both string URLs and Playwright-style dict proxies</p>": "<p>์ง์ ๊ธฐ๋ฅ:\n- ์ฐจ๋ก๋๋ก ๋ฐ๋ณตํ๋ ์ํ(๊ธฐ๋ณธ๊ฐ)\n- ํธ์ถ ๊ฐ๋ฅํ ๊ฐ์ฒด๋ฅผ ํตํ ์ฌ์ฉ์ ์ง์ ์ํ ๋ฐฉ์\n- URL ๋ฌธ์์ด๊ณผ Playwright ํ์์ ๋์ ๋๋ฆฌ๋ก ํ๋ก์ ์ง์ </p>",+ "<p>Initialize the proxy rotator.</p>": "<p>ํ๋ก์ ์ํ ๊ธฐ๋ฅ์ ์ด๊ธฐํํฉ๋๋ค.</p>",+ "<p>List of proxy URLs or Playwright-style proxy dicts.\n- String format: \"http://proxy1:8080\" or \"http://user:pass@proxy:8080\"\n- Dict format: {\"server\": \"http://proxy:8080\", \"username\": \"user\", \"password\": \"pass\"}</p>": "<p>ํ๋ก์ URL ๋๋ Playwright ํ์์ ํ๋ก์ ๋์ ๋๋ฆฌ ๋ฆฌ์คํธ์ ๋๋ค.\n- ๋ฌธ์์ด ํ์: \"http://proxy1:8080\" ๋๋ \"http://user:pass@proxy:8080\"\n- ๋์ ๋๋ฆฌ ํ์: {\"server\": \"http://proxy:8080\", \"username\": \"user\", \"password\": \"pass\"}</p>",+ "<p>Rotation strategy function. Takes (proxies, current_index) and returns (proxy, next_index). Defaults to cyclic_rotation.</p>": "<p>ํ๋ก์ ์ํ ๋ฐฉ์ ํจ์์ ๋๋ค. (proxies, current_index)๋ฅผ ๋ฐ๊ณ (proxy, next_index)๋ฅผ ๋ฐํํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ cyclic_rotation์ ๋๋ค.</p>",+ "<p>Get a copy of all configured proxies.</p>": "<p>์ค์ ํ ๋ชจ๋ ํ๋ก์์ ์ฌ๋ณธ์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Get the next proxy according to the rotation strategy.</p>": "<p>์ํ ๋ฐฉ์์ ๋ฐ๋ผ ๋ค์ ํ๋ก์๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return the total number of configured proxies.</p>": "<p>์ค์ ํ ํ๋ก์์ ์ ์ฒด ๊ฐ์๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Extends standard Python string by adding more functionality</p>": "<p>Python์ ํ์ค ๋ฌธ์์ด์ ๊ธฐ๋ฅ์ ์ถ๊ฐํฉ๋๋ค.</p>",+ "<p>Return a sorted version of the string</p>": "<p>๋ฌธ์๋ฅผ ์ ๋ ฌํ ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return a new version of the string after removing all white spaces and consecutive spaces</p>": "<p>๊ณต๋ฐฑ ๋ฌธ์์ ์ฐ์ ๊ณต๋ฐฑ์ ์ ๊ฑฐํ ์ ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Return JSON response if the response is jsonable otherwise throw error</p>": "<p>์๋ต์ JSON์ผ๋ก ๋ณํํด ๋ฐํํฉ๋๋ค. ๋ณํํ ์ ์์ผ๋ฉด ์ค๋ฅ๋ฅผ ๋ฐ์์ํต๋๋ค.</p>",+ "<p>If enabled, this will ignore all whitespaces and consecutive spaces while matching</p>": "<p>์ผ๋ฉด ์ผ์น ์ฌ๋ถ๋ฅผ ํ์ธํ ๋ ๊ณต๋ฐฑ ๋ฌธ์์ ์ฐ์ ๊ณต๋ฐฑ์ ๋ฌด์ํฉ๋๋ค.</p>",+ "<p>If disabled, function will set the regex to ignore the letters-case while compiling it</p>": "<p>๋๋ฉด ์ ๊ท์์ ์ปดํ์ผํ ๋ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ต๋๋ค.</p>",+ "<p>Used to quickly check if this regex matches or not without any operations on the results</p>": "<p>๊ฒฐ๊ณผ๋ฅผ ๊ฐ๊ณตํ์ง ์๊ณ ์ ๊ท์์ ์ผ์น ์ฌ๋ถ๋ง ๋น ๋ฅด๊ฒ ํ์ธํฉ๋๋ค.</p>",+ "<p>The :class:<code>TextHandlers</code> class is a subclass of the builtin <code>List</code> class, which provides a few additional methods.</p>": "<p>:class:<code>TextHandlers</code>๋ ๊ธฐ๋ณธ <code>List</code>๋ฅผ ์์ํ๊ณ ๋ช ๊ฐ์ง ๋ฉ์๋๋ฅผ ์ถ๊ฐํ ํด๋์ค์ ๋๋ค.</p>",+ "<p>Call the <code>.re()</code> method for each element in this list and return\ntheir results flattened as TextHandlers.</p>": "<p>๋ฆฌ์คํธ์ ๊ฐ ์์์ <code>.re()</code>๋ฅผ ํธ์ถํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ํ๋์ TextHandlers๋ก ํฉ์ณ ๋ฐํํฉ๋๋ค.</p>",+ "<p>if disabled, the function will set the regex to ignore the letters-case while compiling it</p>": "<p>๋๋ฉด ์ ๊ท์์ ์ปดํ์ผํ ๋ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ต๋๋ค.</p>",+ "<p>Call the <code>.re_first()</code> method for each element in this list and return\nthe first result or the default value otherwise.</p>": "<p>๋ฆฌ์คํธ์ ๊ฐ ์์์ <code>.re_first()</code>๋ฅผ ํธ์ถํ๊ณ ์ฒซ ๋ฒ์งธ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค. ๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns the first item of the current list</p>": "<p>ํ์ฌ ๋ฆฌ์คํธ์ ์ฒซ ๋ฒ์งธ ํญ๋ชฉ์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>the default value to return if the current list is empty</p>": "<p>ํ์ฌ ๋ฆฌ์คํธ๊ฐ ๋น์ด ์์ ๋ ๋ฐํํ ๊ธฐ๋ณธ๊ฐ์ ๋๋ค.</p>",+ "<p>A read-only mapping to use instead of the standard dictionary for the speed boost, but at the same time I use it to add more functionalities.\nIf the standard dictionary is needed, convert this class to a dictionary with the <code>dict</code> function</p>": "<p>์ผ๋ฐ ๋์ ๋๋ฆฌ ๋์ ์ฌ์ฉํ๋ ์ฝ๊ธฐ ์ ์ฉ ๋งคํ์ ๋๋ค. ์๋๋ฅผ ๋์ด๊ณ ์ถ๊ฐ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. ์ผ๋ฐ ๋์ ๋๋ฆฌ์ด ํ์ํ๋ฉด <code>dict</code> ํจ์๋ก ๋ณํํ์ธ์.</p>",+ "<p>Convert current attributes to JSON bytes if the attributes are JSON serializable otherwise throws error</p>": "<p>ํ์ฌ ์์ฑ์ JSON ๋ฐ์ดํธ๋ก ๋ณํํฉ๋๋ค. ๋ณํํ ์ ์์ผ๋ฉด ์ค๋ฅ๋ฅผ ๋ฐ์์ํต๋๋ค.</p>",+ "<p>Acts like the standard dictionary <code>.get()</code> method</p>": "<p>์ผ๋ฐ ๋์ ๋๋ฆฌ์ <code>.get()</code> ๋ฉ์๋์ฒ๋ผ ๋์ํฉ๋๋ค.</p>",+ "<p>Search current attributes by values and return a dictionary of each matching item</p>": "<p>ํ์ฌ ์์ฑ์ ๊ฐ์ผ๋ก ๊ฒ์ํ๊ณ ์ผ์นํ๋ ํญ๋ชฉ๋ง๋ค ๋์ ๋๋ฆฌ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>The keyword to search for in the attribute values</p>": "<p>์์ฑ๊ฐ์์ ์ฐพ์ ํค์๋์ ๋๋ค.</p>",+ "<p>If True, the function will search if keyword in each value instead of perfect match</p>": "<p>True์ด๋ฉด ์์ ์ผ์น ๋์ ๊ฐ ๊ฐ์ ํค์๋๊ฐ ํฌํจ๋์ด ์๋์ง ํ์ธํฉ๋๋ค.</p>",+ "<p>Request's response information structure.</p>": "<p>์์ฒญ์ ์๋ต ์ ๋ณด๋ฅผ ๋ด๋ ๊ตฌ์กฐ์ ๋๋ค.</p>",+ "<p><code>browser_network_requests</code> returns <code>NetworkRequestsModel</code> with <code>requests</code>, <code>next_cursor</code>, <code>has_more</code>, and <code>dropped_count</code>. Each <code>NetworkRequestInfo</code> contains <code>id</code>, <code>url</code>, <code>method</code>, <code>resource_type</code>, and <code>status</code>. Pass <code>next_cursor</code> as <code>after_id</code> to continue; <code>has_more</code> indicates more current matches.</p>": "<p><code>browser_network_requests</code>๋ <code>NetworkRequestsModel</code>์ ๋ฐํํ๋ฉฐ <code>requests</code>, <code>next_cursor</code>, <code>has_more</code>, <code>dropped_count</code>๋ฅผ ํฌํจํฉ๋๋ค. ๊ฐ <code>NetworkRequestInfo</code>์๋ <code>id</code>, <code>url</code>, <code>method</code>, <code>resource_type</code>, <code>status</code>๊ฐ ์์ต๋๋ค. ์ด์ด์ ์ฝ์ผ๋ ค๋ฉด <code>next_cursor</code>๋ฅผ <code>after_id</code>๋ก ์ ๋ฌํ์ธ์. <code>has_more</code>๋ ํ์ฌ ์ผ์นํ๋ ๊ฒฐ๊ณผ๊ฐ ๋ ์๋์ง ๋ํ๋ ๋๋ค.</p>",+ "<p><code>browser_network_request</code> returns <code>NetworkRequestModel</code> with <code>request_id</code>, <code>part</code>, <code>data</code>, and <code>note</code>. Summaries and headers are objects; the full saved body text is returned as a string, including JSON response text. <code>note</code> explains missing body data or partial headers.</p>": "<p><code>browser_network_request</code>๋ <code>NetworkRequestModel</code>์ ๋ฐํํ๋ฉฐ <code>request_id</code>, <code>part</code>, <code>data</code>, <code>note</code>๋ฅผ ํฌํจํฉ๋๋ค. ์์ฝ๊ณผ ํค๋๋ ๊ฐ์ฒด์ ๋๋ค. ์ ์ฅ๋ ๋ณธ๋ฌธ ์ ์ฒด๋ JSON ์๋ต๋ ํฌํจํด ๋ฌธ์์ด๋ก ๋ฐํํฉ๋๋ค. <code>note</code>๋ ๋ณธ๋ฌธ ๋ฐ์ดํฐ๊ฐ ์๊ฑฐ๋ ํค๋๊ฐ ์ผ๋ถ๋ง ์๋ ์ด์ ๋ฅผ ์ค๋ช ํฉ๋๋ค.</p>",+ "<p>Summary of a recorded browser request.</p>": "<p>๊ธฐ๋ก๋ ๋ธ๋ผ์ฐ์ ์์ฒญ์ ์์ฝ์ ๋๋ค.</p>",+ "<p>Recorded request summaries and pagination details.</p>": "<p>๊ธฐ๋ก๋ ์์ฒญ ์์ฝ๊ณผ ํ์ด์ง ๋จ์ ์กฐํ ์ ๋ณด์ ๋๋ค.</p>",+ "<p>One complete saved request part, with an optional note.</p>": "<p>์ ์ฅ๋ ์์ฒญ์์ ์ ํํ ๋ถ๋ถ ์ ์ฒด์ ์ ํ์ ๋ฉ๋ชจ์ ๋๋ค.</p>",+ "<p>Model classes for session management:</p>": "<p>์ธ์ ๊ด๋ฆฌ์ ์ฌ์ฉํ๋ ๋ชจ๋ธ ํด๋์ค์ ๋๋ค.</p>",+ "<p>Information about an open browser session.</p>": "<p>์ด๋ฆฐ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ ๋ณด์ ๋๋ค.</p>",+ "<p>Response returned when a new session is created.</p>": "<p>์ ์ธ์ ์ ๋ง๋ค ๋ ๋ฐํํ๋ ์๋ต์ ๋๋ค.</p>",+ "<p>Response returned when a session is closed.</p>": "<p>์ธ์ ์ ๋ซ์ ๋ ๋ฐํํ๋ ์๋ต์ ๋๋ค.</p>",+ "<p>The main MCP server class that provides all web scraping tools:</p>": "<p>๋ชจ๋ ์น ์คํฌ๋ํ ๋๊ตฌ๋ฅผ ์ ๊ณตํ๋ ์ฃผ์ MCP ์๋ฒ ํด๋์ค์ ๋๋ค.</p>",+ "<p><strong><code>browser_fetch_once</code></strong>: Fetch one URL through a stealthy browser with JavaScript rendering and Cloudflare handling, then close the browser. Use a persistent session for later actions or network history.</p>": "<p><strong><code>browser_fetch_once</code></strong>: ์คํ ์ค ๋ธ๋ผ์ฐ์ ์์ JavaScript๋ฅผ ์คํํ๊ณ Cloudflare๋ฅผ ์ฒ๋ฆฌํ๋ฉฐ URL ํ๋๋ฅผ ๊ฐ์ ธ์จ ๋ค ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ซ์ต๋๋ค. ์ดํ์ ์ถ๊ฐ ์์ ์ ํ๊ฑฐ๋ ๋คํธ์ํฌ ๊ธฐ๋ก์ ํ์ธํ๋ ค๋ฉด ์ง์ ์ธ์ ์ ์ฌ์ฉํ์ธ์.</p>",+ "<p><strong><code>browser_extract</code></strong>: Read the current page or one element as an AI snapshot, HTML, Markdown, or text without reloading it. Keep results from forms and page actions. Snapshots include element roles, names, references, positions, and sizes; regex search returns matching lines with nearby context and parent nodes.</p>": "<p><strong><code>browser_extract</code></strong>: ํ์ด์ง๋ฅผ ๋ค์ ๋ก๋ํ์ง ์๊ณ ํ์ฌ ํ์ด์ง๋ ์์ ํ๋๋ฅผ AI ์ค๋ ์ท, HTML, Markdown, ํ ์คํธ๋ก ์ฝ์ต๋๋ค. ํผ ์ ๋ ฅ๊ณผ ํ์ด์ง ์์ ์ ๊ฒฐ๊ณผ๋ฅผ ์ ์งํฉ๋๋ค. ์ค๋ ์ท์๋ ์์์ ์ญํ , ์ด๋ฆ, ์ฐธ์กฐ, ์์น, ํฌ๊ธฐ๊ฐ ํฌํจ๋ฉ๋๋ค. ์ ๊ท์ ๊ฒ์์ ์ผ์นํ๋ ์ค๊ณผ ์ฃผ๋ณ ๋ด์ฉ, ๋ถ๋ชจ ๋ ธ๋๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p><strong><code>browser_actions</code></strong>: Chain mouse moves, hovers, clicks, scrolling, field filling, keyboard shortcuts, dialog replies, and waits in one call. Accept or dismiss alerts and confirmations, or enter text in prompts. Fill a search box, submit it, wait for results, and open a result without a separate call for each step.</p>": "<p><strong><code>browser_actions</code></strong>: ํ ๋ฒ์ ํธ์ถ๋ก ๋ง์ฐ์ค ์ด๋, ๋ง์ฐ์ค ์ฌ๋ฆฌ๊ธฐ, ํด๋ฆญ, ์คํฌ๋กค, ํ๋ ์ ๋ ฅ, ๋จ์ถํค, ๋ํ์์ ์๋ต, ๋๊ธฐ๋ฅผ ์ด์ด์ ์คํํฉ๋๋ค. ์๋ฆผ๊ณผ ํ์ธ ๋ํ์์๋ฅผ ์๋ฝํ๊ฑฐ๋ ๋ซ๊ณ , ์ ๋ ฅ ๋ํ์์์ ํ ์คํธ๋ฅผ ๋ฃ์ ์ ์์ต๋๋ค. ๋จ๊ณ๋ง๋ค ๋ฐ๋ก ํธ์ถํ์ง ์๊ณ ๊ฒ์์ฐฝ์ ์ ๋ ฅํ๊ณ ์ ์ถํ ๋ค ๊ฒฐ๊ณผ๋ฅผ ๊ธฐ๋ค๋ ค ์ด ์ ์์ต๋๋ค.</p>",+ "<p>Moves and clicks target selectors, snapshot references, or coordinates; element targets wait and scroll into view. Supports movement in multiple steps, left, right, and middle clicks, double-clicks, and scrolling nested panels.</p>": "<p>์ ํ์, ์ค๋ ์ท ์ฐธ์กฐ, ์ขํ๋ก ์ด๋๊ณผ ํด๋ฆญ์ ๋์์ ์ง์ ํฉ๋๋ค. ์์๋ฅผ ๋์์ผ๋ก ํ๋ฉด ์ค๋น๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฌ๊ณ ํ๋ฉด์ ๋ณด์ด๋๋ก ์คํฌ๋กคํฉ๋๋ค. ์ฌ๋ฌ ๋จ๊ณ๋ก ๋๋์ด ์ด๋ํ๊ธฐ, ์ผ์ชฝยท์ค๋ฅธ์ชฝยท๊ฐ์ด๋ฐ ๋ฒํผ ํด๋ฆญ, ๋๋ธ ํด๋ฆญ, ์ค์ฒฉ ํจ๋์ ์คํฌ๋กค์ ์ง์ํฉ๋๋ค.</p>",+ "<p>Target fields anywhere on the page through selectors or snapshot references. Fill text, check or uncheck boxes, select radio buttons, and choose one or more native dropdown options by label. Replace or clear text, or type at the current caret. Keyboard shortcuts use the current focus. Slow mode adds random pauses between typed characters and all actions.</p>": "<p>์ ํ์๋ ์ค๋ ์ท ์ฐธ์กฐ๋ก ํ์ด์ง ์ด๋์ ์๋ ํ๋๋ ์ง์ ํ ์ ์์ต๋๋ค. ํ ์คํธ๋ฅผ ์ ๋ ฅํ๊ณ , ์ฒดํฌ๋ฐ์ค๋ฅผ ์ ํํ๊ฑฐ๋ ํด์ ํ๊ณ , ๋ผ๋์ค ๋ฒํผ์ ์ ํํ๊ณ , ๊ธฐ๋ณธ ๋๋กญ๋ค์ด์์ ๋ ์ด๋ธ๋ก ํ๋ ์ด์์ ์ต์ ์ ์ ํํ ์ ์์ต๋๋ค. ํ ์คํธ๋ฅผ ๋ฐ๊พธ๊ฑฐ๋ ์ง์ฐ๊ณ , ํ์ฌ ์ปค์ ์์น์ ์ ๋ ฅํ ์๋ ์์ต๋๋ค. ๋จ์ถํค๋ ํ์ฌ ํฌ์ปค์ค์ ์ ์ฉ๋ฉ๋๋ค. ๋๋ฆฐ ๋ชจ๋๋ ์ ๋ ฅ ๋ฌธ์ ์ฌ์ด์ ๋ชจ๋ ์์ ์ฌ์ด์ ์์์ ๋๊ธฐ ์๊ฐ์ ๋ฃ์ต๋๋ค.</p>",+ "<p>Wait for content or loading overlays through selectors or snapshot references, wait for page load events or settled network activity, or add a fixed pause before continuing.</p>": "<p>์ ํ์๋ ์ค๋ ์ท ์ฐธ์กฐ๋ก ์ฝํ ์ธ ๋ ๋ก๋ฉ ์ค๋ฒ๋ ์ด๋ฅผ ๊ธฐ๋ค๋ฆฌ๊ณ , ํ์ด์ง ๋ก๋ ์ด๋ฒคํธ๋ ๋คํธ์ํฌ ํ๋์ด ์ฆ์๋ค ๋๊น์ง ๊ธฐ๋ค๋ฆด ์ ์์ต๋๋ค. ๊ณ์ ์งํํ๊ธฐ ์ ์ ์ ํด์ง ์๊ฐ๋งํผ ๋ฉ์ถ ์๋ ์์ต๋๋ค.</p>",+ "<p><strong><code>browser_evaluate</code></strong>: Run JavaScript on the current page to extract custom data, calculate results, read application state, or update page content. Supports asynchronous scripts and returns their results as JSON.</p>": "<p><strong><code>browser_evaluate</code></strong>: ํ์ฌ ํ์ด์ง์์ JavaScript๋ฅผ ์คํํด ์ํ๋ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๊ณ , ๊ฒฐ๊ณผ๋ฅผ ๊ณ์ฐํ๊ณ , ์ ํ๋ฆฌ์ผ์ด์ ์ํ๋ฅผ ์ฝ๊ณ , ํ์ด์ง ๋ด์ฉ์ ๋ฐ๊ฟ๋๋ค. ๋น๋๊ธฐ ์คํฌ๋ฆฝํธ๋ฅผ ์ง์ํ๋ฉฐ ๊ฒฐ๊ณผ๋ฅผ JSON์ผ๋ก ๋ฐํํฉ๋๋ค.</p>",+ "<p>Create a Scrapling MCP server.</p>": "<p>Scrapling MCP ์๋ฒ๋ฅผ ๋ง๋ญ๋๋ค.</p>",+ "<p>Optional global Chromium-compatible browser executable path for browser tools.\nIf omitted, the SCRAPLING_EXECUTABLE_PATH environment variable is used when set.</p>": "<p>๋ธ๋ผ์ฐ์ ๋๊ตฌ์ ๊ณตํต์ผ๋ก ์ฌ์ฉํ Chromium ํธํ ๋ธ๋ผ์ฐ์ ์ ์คํ ํ์ผ ๊ฒฝ๋ก์ ๋๋ค. ์ ํ ์ฌํญ์ ๋๋ค. ์๋ตํ๋ฉด ์ค์ ๋ SCRAPLING_EXECUTABLE_PATH ํ๊ฒฝ ๋ณ์์ ๊ฐ์ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Optional shared token that clients must send as <code>Authorization: Bearer <token></code>.\nIf omitted, the SCRAPLING_MCP_AUTH_TOKEN environment variable is used when set. It only applies\nto the streamable-http transport.</p>": "<p>ํด๋ผ์ด์ธํธ๊ฐ <code>Authorization: Bearer <token></code>์ผ๋ก ๋ณด๋ด์ผ ํ๋ ๊ณต์ ํ ํฐ์ ๋๋ค. ์ ํ ์ฌํญ์ ๋๋ค. ์๋ตํ๋ฉด ์ค์ ๋ SCRAPLING_MCP_AUTH_TOKEN ํ๊ฒฝ ๋ณ์์ ๊ฐ์ ์ฌ์ฉํฉ๋๋ค. streamable-http ์ ์ก ๋ฐฉ์์๋ง ์ ์ฉ๋ฉ๋๋ค.</p>",+ "<p>Open a reusable stealthy browser session. Pass per-request options to <code>browser_fetch</code>.</p>": "<p>์ฌ์ฌ์ฉํ ์ ์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ฝ๋๋ค. ์์ฒญ๋ณ ์ต์ ์ <code>browser_fetch</code>์ ์ ๋ฌํ์ธ์.</p>",+ "<p>Save browser cookies, local storage and IndexedDB as Playwright-compatible JSON. Excludes sessionStorage.</p>": "<p>๋ธ๋ผ์ฐ์ ์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ Playwright ํธํ JSON์ผ๋ก ์ ์ฅํฉ๋๋ค. sessionStorage๋ ํฌํจํ์ง ์์ต๋๋ค.</p>",+ "<p>Replace browser cookies, local storage and IndexedDB from a Playwright-compatible JSON file.</p>": "<p>Playwright ํธํ JSON ํ์ผ์ ๋ด์ฉ์ผ๋ก ๋ธ๋ผ์ฐ์ ์ฟ ํค, ๋ก์ปฌ ์คํ ๋ฆฌ์ง, IndexedDB๋ฅผ ๊ต์ฒดํฉ๋๋ค.</p>",+ "<p>Leaves sessionStorage and open tabs unchanged. Fetch or reload pages to use the restored login.</p>": "<p>sessionStorage์ ์ด๋ฆฐ ํญ์ ๊ทธ๋๋ก ๋ก๋๋ค. ๋ณต์๋ ๋ก๊ทธ์ธ ์ํ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ค๊ฑฐ๋ ๋ค์ ๋ก๋ํ์ธ์.</p>",+ "<p>Open a reusable HTTP session for <code>session_make_request</code>, keeping cookies, connections, and request settings.</p>": "<p><code>session_make_request</code>์ ์ฌ์ฉํ ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ HTTP ์ธ์ ์ ์ฝ๋๋ค. ์ฟ ํค, ์ฐ๊ฒฐ, ์์ฒญ ์ค์ ์ ์ ์งํฉ๋๋ค.</p>",+ "<p>Close a session and free its resources.</p>": "<p>์ธ์ ์ ๋ซ๊ณ ์ฌ์ฉํ ๋ฆฌ์์ค๋ฅผ ํด์ ํฉ๋๋ค.</p>",+ "<p>List registered sessions, their status, and effective settings.</p>": "<p>๋ฑ๋ก๋ ์ธ์ ๊ณผ ๊ฐ ์ธ์ ์ ์ํ, ์ค์ ์ ์ฉ๋ ์ค์ ์ ๋์ดํฉ๋๋ค.</p>",+ "<p>List completed requests across page changes, with IDs and pagination. Recording starts when the browser session opens.</p>": "<p>ํ์ด์ง๊ฐ ๋ฐ๋์ด๋ ์๋ฃ๋ ์์ฒญ์ ID์ ํจ๊ป ๋์ดํ๋ฉฐ ํ์ด์ง ๋จ์ ์กฐํ๋ฅผ ์ง์ํฉ๋๋ค. ๊ธฐ๋ก์ ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ด ๋ ์์๋ฉ๋๋ค.</p>",+ "<p>Read a complete saved request part without resending it, with structured data and availability notes.</p>": "<p>์์ฒญ์ ๋ค์ ๋ณด๋ด์ง ์๊ณ ์ ์ฅ๋ ์์ฒญ์ ํน์ ๋ถ๋ถ ์ ์ฒด๋ฅผ ์ฝ์ต๋๋ค. ๊ตฌ์กฐํ๋ ๋ฐ์ดํฐ์ ๋ฐ์ดํฐ ์ ๊ณต ์ฌ๋ถ์ ๋ํ ์๋ด๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Read the current page or one element as snapshot, HTML, Markdown, or text without navigating.\nReturn plain text; snapshot search keeps refs, ancestor paths and three lines of nearby context.</p>": "<p>๋ค๋ฅธ ํ์ด์ง๋ก ์ด๋ํ์ง ์๊ณ ํ์ฌ ํ์ด์ง๋ ์์ ํ๋๋ฅผ ์ค๋ ์ท, HTML, Markdown, ํ ์คํธ๋ก ์ฝ์ต๋๋ค. ์ผ๋ฐ ํ ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค. ์ค๋ ์ท ๊ฒ์์ ์ฐธ์กฐ, ์กฐ์ ์์ ๊ฒฝ๋ก, ์ฃผ๋ณ ๋ด์ฉ ์ธ ์ค์ ์ ์งํฉ๋๋ค.</p>",+ "<p>Run mouse, field, key, dialog, and wait actions in order; return plain text without a snapshot.\nStop on the first error, identifying its action; partial effects remain. No retries.\nElement mouse targets auto-wait and scroll into view; coordinates and wheel do not wait for navigation or scrolling.\nCancelled/timed-out clicks attempt button release. Load waits observe the current document, not future navigation.</p>": "<p>๋ง์ฐ์ค, ํ๋, ํค, ๋ํ์์, ๋๊ธฐ ์์ ์ ์์๋๋ก ์คํํ๊ณ ์ค๋ ์ท ์์ด ์ผ๋ฐ ํ ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค. ์ฒซ ์ค๋ฅ์์ ์ค๋จํ๊ณ ํด๋น ์์ ์ ์๋ ค์ค๋๋ค. ์ด๋ฏธ ์ ์ฉ๋ ๋ณ๊ฒฝ์ ์ ์ง๋๋ฉฐ ์ฌ์๋ํ์ง ์์ต๋๋ค. ๋ง์ฐ์ค ์์ ์ ๋์์ด ์์์ด๋ฉด ์๋์ผ๋ก ๊ธฐ๋ค๋ฆฌ๊ณ ๋ณด์ด๋๋ก ์คํฌ๋กคํฉ๋๋ค. ์ขํ์ ํ ์์ ์ ํ์ด์ง ์ด๋์ด๋ ์คํฌ๋กค ์๋ฃ๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์์ต๋๋ค. ํด๋ฆญ์ด ์ทจ์๋๊ฑฐ๋ ์ ํ ์๊ฐ์ ๋๊ธฐ๋ฉด ๋ฒํผ์ ๋์ผ๋ ค๊ณ ์๋ํฉ๋๋ค. ๋ก๋ ๋๊ธฐ๋ ํ์ฌ ๋ฌธ์๋ฅผ ๊ด์ฐฐํ๋ฉฐ ์ดํ์ ํ์ด์ง ์ด๋์ ๊ธฐ๋ค๋ฆฌ์ง ์์ต๋๋ค.</p>",+ "<p>Run JavaScript on the current page, await promises, and return JSON text without a snapshot.\nReturn JSON-compatible values; null/undefined become null. Script effects are not undone on failure.\nCancellation stops waiting, but may not stop the script.</p>": "<p>ํ์ฌ ํ์ด์ง์์ JavaScript๋ฅผ ์คํํ๊ณ Promise๋ฅผ ๊ธฐ๋ค๋ฆฐ ๋ค ์ค๋ ์ท ์์ด JSON ํ ์คํธ๋ฅผ ๋ฐํํฉ๋๋ค. JSON๊ณผ ํธํ๋๋ ๊ฐ์ ๋ฐํํ์ธ์. null/undefined๋ null์ด ๋ฉ๋๋ค. ์คํจํด๋ ์คํฌ๋ฆฝํธ๊ฐ ์ ์ฉํ ๋ณ๊ฒฝ์ ๋๋๋ฆฌ์ง ์์ต๋๋ค. ์ทจ์ํ๋ฉด ๋๊ธฐ๋ ๋๋์ง๋ง ์คํฌ๋ฆฝํธ๋ ๊ณ์ ์คํ๋ ์ ์์ต๋๋ค.</p>",+ "<p>Capture the current page or one element without navigating; return the image and current URL.\nElement capture waits and scrolls into view. Use browser_actions for other waits before capture.</p>": "<p>๋ค๋ฅธ ํ์ด์ง๋ก ์ด๋ํ์ง ์๊ณ ํ์ฌ ํ์ด์ง๋ ์์ ํ๋๋ฅผ ์บก์ฒํ๊ณ ์ด๋ฏธ์ง์ ํ์ฌ URL์ ๋ฐํํฉ๋๋ค. ์์๋ฅผ ์บก์ฒํ ๋๋ ๊ธฐ๋ค๋ฆฐ ๋ค ํ๋ฉด์ ๋ณด์ด๋๋ก ์คํฌ๋กคํฉ๋๋ค. ์บก์ฒ ์ ์ ๋ค๋ฅธ ๋๊ธฐ๊ฐ ํ์ํ๋ฉด browser_actions๋ฅผ ์ฌ์ฉํ์ธ์.</p>",+ "<p>Make an HTTP request without JavaScript. Suitable for low-to-mid protection.</p>": "<p>JavaScript ์์ด HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ๋ณดํธ ์์ค์ด ๋ฎ๊ฑฐ๋ ์ค๊ฐ์ธ ์ฌ์ดํธ์ ์ ํฉํฉ๋๋ค.</p>",+ "<p>Fetch a page with a stealth browser and JavaScript rendering.</p>": "<p>์คํ ์ค ๋ธ๋ผ์ฐ์ ์์ JavaScript๋ฅผ ์คํํ๋ฉฐ ํ์ด์ง๋ฅผ ๊ฐ์ ธ์ต๋๋ค.</p>",+ "<p>Fetch a URL in an open stealthy browser session. Options apply only to this request.</p>": "<p>์ด๋ ค ์๋ ์คํ ์ค ๋ธ๋ผ์ฐ์ ์ธ์ ์์ URL์ ๊ฐ์ ธ์ต๋๋ค. ์ต์ ์ ์ด ์์ฒญ์๋ง ์ ์ฉ๋ฉ๋๋ค.</p>",+ "<p>Make an HTTP request using the session's cookies, connections, impersonation, and proxy. Options apply to this request.</p>": "<p>์ธ์ ์ ์ฟ ํค, ์ฐ๊ฒฐ, ๋ธ๋ผ์ฐ์ ๋ชจ๋ฐฉ ์ค์ , ํ๋ก์๋ฅผ ์ฌ์ฉํด HTTP ์์ฒญ์ ๋ณด๋ ๋๋ค. ์ต์ ์ ์ด ์์ฒญ์ ์ ์ฉ๋ฉ๋๋ค.</p>",+ "<p>Serve the MCP server.</p>": "<p>MCP ์๋ฒ๋ฅผ ์คํํด ์์ฒญ์ ๋ฐ์ต๋๋ค.</p>",+ "<p>Serve over the streamable-http transport instead of stdio.</p>": "<p>stdio ๋์ streamable-http ์ ์ก ๋ฐฉ์์ผ๋ก ์คํํฉ๋๋ค.</p>",+ "<p>The host to bind to when <code>http</code> is enabled.</p>": "<p><code>http</code>๊ฐ ์ผ์ ธ ์์ ๋ ๋ฐ์ธ๋ฉํ ํธ์คํธ์ ๋๋ค.</p>",+ "<p>The port to bind to when <code>http</code> is enabled.</p>": "<p><code>http</code>๊ฐ ์ผ์ ธ ์์ ๋ ๋ฐ์ธ๋ฉํ ํฌํธ์ ๋๋ค.</p>",+ "<p>Host names to accept, which turns on DNS-rebinding protection.</p>": "<p>ํ์ฉํ ํธ์คํธ ์ด๋ฆ์ ๋๋ค. ์ง์ ํ๋ฉด DNS ๋ฆฌ๋ฐ์ธ๋ฉ ๋ณดํธ ๊ธฐ๋ฅ์ด ์ผ์ง๋๋ค.</p>",+ "<p>Start the streamable-http transport without a token. The transport\nrequires authentication by default, so this is the explicit opt-out.</p>": "<p>ํ ํฐ ์์ด streamable-http ์ ์ก ๋ฐฉ์์ ์์ํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ์ธ์ฆ์ด ํ์ํ๋ฏ๋ก ์ด ์ต์ ์ผ๋ก ์ธ์ฆ์ ๋ช ์์ ์ผ๋ก ๋๋๋ค.</p>",+ "<p>The <code>Selectors</code> class is a subclass of the builtin <code>List</code> class, which provides a few additional methods.</p>": "<p><code>Selectors</code> ํด๋์ค๋ ๋ด์ฅ <code>List</code> ํด๋์ค๋ฅผ ์์ํ๋ฉฐ ๋ช ๊ฐ์ง ๋ฉ์๋๋ฅผ ์ถ๊ฐํฉ๋๋ค.</p>",+ "<p>Returns the first Selector item of the current list or <code>None</code> if the list is empty</p>": "<p>ํ์ฌ ๋ชฉ๋ก์ ์ฒซ ๋ฒ์งธ Selector ํญ๋ชฉ์ ๋ฐํํฉ๋๋ค. ๋ชฉ๋ก์ด ๋น์ด ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns the last Selector item of the current list or <code>None</code> if the list is empty</p>": "<p>ํ์ฌ ๋ชฉ๋ก์ ๋ง์ง๋ง Selector ํญ๋ชฉ์ ๋ฐํํฉ๋๋ค. ๋ชฉ๋ก์ด ๋น์ด ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns the length of the current list</p>": "<p>ํ์ฌ ๋ชฉ๋ก์ ๊ธธ์ด๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Call the <code>.xpath()</code> method for each element in this list and return\ntheir results as another <code>Selectors</code> class.</p>": "<p>๋ชฉ๋ก์ ๊ฐ ์์์์ <code>.xpath()</code> ๋ฉ์๋๋ฅผ ํธ์ถํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ค๋ฅธ <code>Selectors</code> ๊ฐ์ฒด๋ก ๋ฐํํฉ๋๋ค.</p>",+ "<p>A string that will be used to retrieve element's data in adaptive,\notherwise the selector will be used.</p>": "<p>์ ์ํ ํ์ฑ์์ ์์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฐ ์ฌ์ฉํ ๋ฌธ์์ด์ ๋๋ค. ์ง์ ํ์ง ์์ผ๋ฉด ์ ํ์๋ฅผ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Call the <code>.css()</code> method for each element in this list and return\ntheir results flattened as another <code>Selectors</code> class.</p>": "<p>๋ชฉ๋ก์ ๊ฐ ์์์์ <code>.css()</code> ๋ฉ์๋๋ฅผ ํธ์ถํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ํ๋๋ก ํฉ์ณ ๋ค๋ฅธ <code>Selectors</code> ๊ฐ์ฒด๋ก ๋ฐํํฉ๋๋ค.</p>",+ "<p>Call the <code>.re()</code> method for each element in this list and return\ntheir results flattened as List of TextHandler.</p>": "<p>๋ชฉ๋ก์ ๊ฐ ์์์์ <code>.re()</code> ๋ฉ์๋๋ฅผ ํธ์ถํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ํ๋๋ก ํฉ์ณ TextHandler ๋ชฉ๋ก์ผ๋ก ๋ฐํํฉ๋๋ค.</p>",+ "<p>if disabled, function will set the regex to ignore the letters case while compiling it</p>": "<p>๋๋ฉด ์ ๊ท์์ ์ปดํ์ผํ ๋ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์๋๋ก ์ค์ ํฉ๋๋ค.</p>",+ "<p>Loop over all current elements and return the first element that matches the passed function</p>": "<p>ํ์ฌ ๋ชจ๋ ์์๋ฅผ ์ํํ๋ฉฐ ์ ๋ฌํ ํจ์์ ์กฐ๊ฑด์ ๋ง๋ ์ฒซ ๋ฒ์งธ ์์๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>A function that takes each element as an argument and returns True/False</p>": "<p>๊ฐ ์์๋ฅผ ์ธ์๋ก ๋ฐ์ True/False๋ฅผ ๋ฐํํ๋ ํจ์์ ๋๋ค.</p>",+ "<p>The first element that match the function or <code>None</code> otherwise.</p>": "<p>ํจ์์ ์กฐ๊ฑด์ ๋ง๋ ์ฒซ ๋ฒ์งธ ์์๋ฅผ ๋ฐํํฉ๋๋ค. ์์ผ๋ฉด <code>None</code>์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Filter current elements based on the passed function</p>": "<p>์ ๋ฌํ ํจ์๋ฅผ ๊ธฐ์ค์ผ๋ก ํ์ฌ ์์๋ฅผ ๊ฑธ๋ฌ๋ ๋๋ค.</p>",+ "<p>The new <code>Selectors</code> object or empty list otherwise.</p>": "<p>์ <code>Selectors</code> ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค. ์ผ์นํ๋ ์์๊ฐ ์์ผ๋ฉด ๋น ๋ชฉ๋ก์ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Returns the serialized string of the first element, or <code>default</code> if empty.</p>": "<p>์ฒซ ๋ฒ์งธ ์์๋ฅผ ์ง๋ ฌํํ ๋ฌธ์์ด์ ๋ฐํํฉ๋๋ค. ๋น์ด ์์ผ๋ฉด <code>default</code>๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Serialize all elements and return as a TextHandlers list.</p>": "<p>๋ชจ๋ ์์๋ฅผ ์ง๋ ฌํํด TextHandlers ๋ชฉ๋ก์ผ๋ก ๋ฐํํฉ๋๋ค.</p>",+ "<p>An abstract base class for creating web spiders.</p>": "<p>์น Spider๋ฅผ ๋ง๋ค๊ธฐ ์ํ ์ถ์ ๊ธฐ๋ฐ ํด๋์ค์ ๋๋ค.</p>",+ "<p>Check the documentation website for more information.</p>": "<p>์์ธํ ๋ด์ฉ์ ๋ฌธ์ ์น์ฌ์ดํธ๋ฅผ ํ์ธํ์ธ์.</p>",+ "<p>Initialize the spider.</p>": "<p>Spider๋ฅผ ์ด๊ธฐํํฉ๋๋ค.</p>",+ "<p>Directory for checkpoint files. If provided, enables pause/resume.</p>": "<p>์ฒดํฌํฌ์ธํธ ํ์ผ์ ์ ์ฅํ ๋๋ ํฐ๋ฆฌ์ ๋๋ค. ์ง์ ํ๋ฉด ์ผ์ ์ค์ง์ ์ฌ๊ฐ ๊ธฐ๋ฅ์ด ์ผ์ง๋๋ค.</p>",+ "<p>Seconds between periodic checkpoint saves (default 5 minutes).</p>": "<p>์ฃผ๊ธฐ์ ์ผ๋ก ์ฒดํฌํฌ์ธํธ๋ฅผ ์ ์ฅํ๋ ๊ฐ๊ฒฉ์ ๋๋ค. ๋จ์๋ ์ด์ด๋ฉฐ ๊ธฐ๋ณธ๊ฐ์ 5๋ถ์ ๋๋ค.</p>",+ "<p>Access current crawl stats (works during streaming).</p>": "<p>ํ์ฌ ํฌ๋กค๋ง ํต๊ณ์ ์ ๊ทผํฉ๋๋ค. ์คํธ๋ฆฌ๋ฐ ์ค์๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>Generate initial requests to start the crawl.</p>": "<p>ํฌ๋กค๋ง์ ์์ํ ์ด๊ธฐ ์์ฒญ์ ์์ฑํฉ๋๋ค.</p>",+ "<p>By default, this generates Request objects for each URL in <code>start_urls</code>\nusing the session manager's default session and <code>parse()</code> as callback.</p>": "<p>๊ธฐ๋ณธ์ ์ผ๋ก <code>start_urls</code>์ ๊ฐ URL์ ๋ํด Request ๊ฐ์ฒด๋ฅผ ์์ฑํฉ๋๋ค. ์ธ์ ๊ด๋ฆฌ์์ ๊ธฐ๋ณธ ์ธ์ ๊ณผ <code>parse()</code> ์ฝ๋ฐฑ์ ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>Override this method for more control over initial requests\n(e.g., to add custom headers, use different callbacks, etc.)</p>": "<p>์ด๊ธฐ ์์ฒญ์ ๋ ์ธ๋ฐํ๊ฒ ์ ์ดํ๋ ค๋ฉด ์ด ๋ฉ์๋๋ฅผ ์ฌ์ ์ํ์ธ์. ์๋ฅผ ๋ค์ด ์ฌ์ฉ์ ์ง์ ํค๋๋ฅผ ์ถ๊ฐํ๊ฑฐ๋ ๋ค๋ฅธ ์ฝ๋ฐฑ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>Default callback for processing responses</p>": "<p>์๋ต์ ์ฒ๋ฆฌํ๋ ๊ธฐ๋ณธ ์ฝ๋ฐฑ์ ๋๋ค.</p>",+ "<p>Called before crawling starts. Override for setup logic.</p>": "<p>ํฌ๋กค๋ง์ด ์์๋๊ธฐ ์ ์ ํธ์ถ๋ฉ๋๋ค. ์ค๋น ์์ ์ ํ๋ ค๋ฉด ์ฌ์ ์ํ์ธ์.</p>",+ "<p>It's enabled if the spider is resuming from a checkpoint, left for the user to use.</p>": "<p>Spider๊ฐ ์ฒดํฌํฌ์ธํธ์์ ์ฌ๊ฐ๋ ๋ ์ผ์ง๋๋ค. ์ฌ์ฉ์๊ฐ ํ์์ ๋ฐ๋ผ ํ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>Called after crawling finishes. Override for cleanup logic.</p>": "<p>ํฌ๋กค๋ง์ด ๋๋ ๋ค ํธ์ถ๋ฉ๋๋ค. ์ ๋ฆฌ ์์ ์ ํ๋ ค๋ฉด ์ฌ์ ์ํ์ธ์.</p>",+ "<p>Handle request errors for all spider requests.</p>": "<p>Spider์ ๋ชจ๋ ์์ฒญ์์ ๋ฐ์ํ๋ ์์ฒญ ์ค๋ฅ๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค.</p>",+ "<p>Override for custom error handling.</p>": "<p>์ค๋ฅ ์ฒ๋ฆฌ ๋ฐฉ์์ ๋ฐ๊พธ๋ ค๋ฉด ์ฌ์ ์ํ์ธ์.</p>",+ "<p>A hook to be overridden by users to do some processing on scraped items, return <code>None</code> to drop the item silently.</p>": "<p>์คํฌ๋ํํ ํญ๋ชฉ์ ์ฒ๋ฆฌํ๋๋ก ์ฌ์ฉ์๊ฐ ์ฌ์ ์ํ ์ ์๋ ํ ์ ๋๋ค. <code>None</code>์ ๋ฐํํ๋ฉด ๋ณ๋ ์๋ฆผ ์์ด ํญ๋ชฉ์ ๋ฒ๋ฆฝ๋๋ค.</p>",+ "<p>Check if the response is blocked. Users should override this for custom detection logic.</p>": "<p>์๋ต์ด ์ฐจ๋จ๋์๋์ง ํ์ธํฉ๋๋ค. ์ฐจ๋จ ๊ฐ์ง ๋ฐฉ์์ ๋ฐ๊พธ๋ ค๋ฉด ์ฌ์ ์ํ์ธ์.</p>",+ "<p>Users should override this to prepare the blocked request before retrying, if needed.</p>": "<p>์ฌ์๋ ์ ์ ์ฐจ๋จ๋ ์์ฒญ์ ์์ ํด์ผ ํ๋ค๋ฉด ์ด ๋ฉ์๋๋ฅผ ์ฌ์ ์ํ์ธ์.</p>",+ "<p>String representation of the spider.</p>": "<p>Spider๋ฅผ ๋ํ๋ด๋ ๋ฌธ์์ด์ ๋๋ค.</p>",+ "<p>Configure sessions for this spider.</p>": "<p>์ด Spider์ ์ธ์ ์ ์ค์ ํฉ๋๋ค.</p>",+ "<p>Override this method to add custom sessions.\nThe default implementation creates a FetcherSession session.</p>": "<p>์ฌ์ฉ์ ์ง์ ์ธ์ ์ ์ถ๊ฐํ๋ ค๋ฉด ์ด ๋ฉ์๋๋ฅผ ์ฌ์ ์ํ์ธ์. ๊ธฐ๋ณธ ๊ตฌํ์ FetcherSession ์ธ์ ์ ๋ง๋ญ๋๋ค.</p>",+ "<p>The first session added becomes the default for <code>start_requests()</code> unless specified otherwise.</p>": "<p>๋ฐ๋ก ์ง์ ํ์ง ์์ผ๋ฉด ์ฒ์ ์ถ๊ฐํ ์ธ์ ์ด <code>start_requests()</code>์ ๊ธฐ๋ณธ ์ธ์ ์ด ๋ฉ๋๋ค.</p>",+ "<p>SessionManager to configure</p>": "<p>์ค์ ํ SessionManager์ ๋๋ค.</p>",+ "<p>Request graceful shutdown of the crawling process.</p>": "<p>์งํ ์ค์ธ ์์ ์ด ๋๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฐ ๋ค ํฌ๋กค๋ง์ ์ข ๋ฃํ๋๋ก ์์ฒญํฉ๋๋ค.</p>",+ "<p>Run the spider and return results.</p>": "<p>Spider๋ฅผ ์คํํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค.</p>",+ "<p>This is the main entry point for running a spider.\nHandles async execution internally via anyio.</p>": "<p>Spider๋ฅผ ์คํํ๋ ๊ธฐ๋ณธ ์ง์ ์ ์ ๋๋ค. ๋ด๋ถ์์ anyio๋ก ๋น๋๊ธฐ ์คํ์ ์ฒ๋ฆฌํฉ๋๋ค.</p>",+ "<p>Pressing Ctrl+C will initiate graceful shutdown (waits for active tasks to complete).\nPressing Ctrl+C a second time will force immediate stop.</p>": "<p>Ctrl+C๋ฅผ ๋๋ฅด๋ฉด ์งํ ์ค์ธ ์์ ์ด ๋๋ ๋๊น์ง ๊ธฐ๋ค๋ฆฐ ๋ค ์ข ๋ฃํฉ๋๋ค. Ctrl+C๋ฅผ ํ ๋ฒ ๋ ๋๋ฅด๋ฉด ์ฆ์ ๊ฐ์ ๋ก ์ค๋จํฉ๋๋ค.</p>",+ "<p>If crawldir is set, a checkpoint will also be saved on graceful shutdown,\nallowing you to resume the crawl later by running the spider again.</p>": "<p>crawldir์ด ์ค์ ๋์ด ์์ผ๋ฉด ์งํ ์ค์ธ ์์ ์ ๊ธฐ๋ค๋ฆฐ ๋ค ์ข ๋ฃํ ๋ ์ฒดํฌํฌ์ธํธ๋ ์ ์ฅํฉ๋๋ค. ๋์ค์ Spider๋ฅผ ๋ค์ ์คํํด ํฌ๋กค๋ง์ ์ฌ๊ฐํ ์ ์์ต๋๋ค.</p>",+ "<p>Whether to use the faster uvloop/winloop event loop implementation, if available.</p>": "<p>์ฌ์ฉํ ์ ์๋ค๋ฉด ๋ ๋น ๋ฅธ uvloop/winloop ์ด๋ฒคํธ ๋ฃจํ ๊ตฌํ์ ์ฌ์ฉํ ์ง ์ ํฉ๋๋ค.</p>",+ "<p>Asyncio backend options to be used with <code>anyio.run</code></p>": "<p><code>anyio.run</code>์ ์ฌ์ฉํ Asyncio ๋ฐฑ์๋ ์ต์ ์ ๋๋ค.</p>",+ "<p>Stream items as they're scraped. Ideal for long-running spiders or building applications on top of the spiders.</p>": "<p>์คํฌ๋ํํ ํญ๋ชฉ์ ๋ฐ๋ก ์คํธ๋ฆฌ๋ฐํฉ๋๋ค. ์ค๋ ์คํ๋๋ Spider๋ Spider๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋ง๋ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ํฉํฉ๋๋ค.</p>",+ "<p>Must be called from an async context. Yields items one by one as they are scraped.\nAccess <code>spider.stats</code> during iteration for real-time statistics.</p>": "<p>๋น๋๊ธฐ ์ปจํ ์คํธ์์ ํธ์ถํด์ผ ํฉ๋๋ค. ์คํฌ๋ํํ ํญ๋ชฉ์ ํ๋์ฉ ๋ด๋ณด๋ ๋๋ค. ๋ฐ๋ณต ์ค์ <code>spider.stats</code>๋ก ์ค์๊ฐ ํต๊ณ์ ์ ๊ทผํ ์ ์์ต๋๋ค.</p>",+ "<p>Note: SIGINT handling for pause/resume is not available in stream mode.</p>": "<p>์ฐธ๊ณ : ์คํธ๋ฆผ ๋ชจ๋์์๋ ์ผ์ ์ค์ง์ ์ฌ๊ฐ๋ฅผ ์ํ SIGINT ์ฒ๋ฆฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.</p>",+ "<p>Create a copy of this request.</p>": "<p>์ด ์์ฒญ์ ๋ณต์ฌ๋ณธ์ ๋ง๋ญ๋๋ค.</p>",+ "<p>Generate a unique fingerprint for deduplication.</p>": "<p>์ค๋ณต ์ ๊ฑฐ๋ฅผ ์ํ ๊ณ ์ ์ง๋ฌธ์ ์์ฑํฉ๋๋ค.</p>",+ "<p>Caches the result in self._fp after first computation.</p>": "<p>์ฒ์ ๊ณ์ฐํ ๋ค ๊ฒฐ๊ณผ๋ฅผ self._fp์ ์บ์ํฉ๋๋ค.</p>",+ "<p>Compare requests by priority</p>": "<p>์ฐ์ ์์๋ก ์์ฒญ์ ๋น๊ตํฉ๋๋ค.</p>",+ "<p>Requests are equal if they have the same fingerprint.</p>": "<p>์ง๋ฌธ์ด ๊ฐ์ ์์ฒญ์ ๊ฐ์ ๊ฒ์ผ๋ก ๊ฐ์ฃผํฉ๋๋ค.</p>",+ "<p>Prepare state for pickling - store callback as name string for pickle compatibility.</p>": "<p>pickle๋ก ์ง๋ ฌํํ ์ํ๋ฅผ ์ค๋นํฉ๋๋ค. pickle๊ณผ ํธํ๋๋๋ก ์ฝ๋ฐฑ์ ์ด๋ฆ์ ๋ฌธ์์ด๋ก ์ ์ฅํฉ๋๋ค.</p>",+ "<p>Restore state from pickle - callback restored later via _restore_callback().</p>": "<p>pickle์์ ์ํ๋ฅผ ๋ณต์ํฉ๋๋ค. ์ฝ๋ฐฑ์ ๋์ค์ _restore_callback()์ผ๋ก ๋ณต์ํฉ๋๋ค.</p>",+ "<p>Complete result from a spider run.</p>": "<p>Spider ์คํ์ ์ ์ฒด ๊ฒฐ๊ณผ์ ๋๋ค.</p>",+ "<p>True if the crawl completed normally (not paused).</p>": "<p>ํฌ๋กค๋ง์ด ์ผ์ ์ค์ง๊ฐ ์๋ ์ ์ ์ข ๋ฃ๋์์ผ๋ฉด True์ ๋๋ค.</p>",+ "<p>Statistics for a crawl run.</p>": "<p>ํฌ๋กค๋ง ์คํ ํต๊ณ์ ๋๋ค.</p>",+ "<p>A list of scraped items with export capabilities.</p>": "<p>๋ด๋ณด๋ด๊ธฐ ๊ธฐ๋ฅ์ด ์๋ ์คํฌ๋ํ ํญ๋ชฉ ๋ชฉ๋ก์ ๋๋ค.</p>",+ "<p>Export items to a JSON file.</p>": "<p>ํญ๋ชฉ์ JSON ํ์ผ๋ก ๋ด๋ณด๋ ๋๋ค.</p>",+ "<p>Path to the output file</p>": "<p>์ถ๋ ฅ ํ์ผ์ ๊ฒฝ๋ก์ ๋๋ค.</p>",+ "<p>Pretty-print with 2-space indentation (slightly slower)</p>": "<p>๊ณต๋ฐฑ 2์นธ์ผ๋ก ๋ค์ฌ์ฐ๊ธฐํด ์ฝ๊ธฐ ์ฝ๊ฒ ์ถ๋ ฅํฉ๋๋ค. ์ฝ๊ฐ ๋๋ฆฝ๋๋ค.</p>",+ "<p>Export items as JSON Lines (one JSON object per line).</p>": "<p>ํญ๋ชฉ์ JSON Lines๋ก ๋ด๋ณด๋ ๋๋ค. ํ ์ค์ JSON ๊ฐ์ฒด ํ๋๋ฅผ ์๋๋ค.</p>",+ "<p>Export items to a CSV file.</p>": "<p>ํญ๋ชฉ์ CSV ํ์ผ๋ก ๋ด๋ณด๋ ๋๋ค.</p>",+ "<p>Items that don't share the same keys are still written, with the missing cells left empty, and any value\nthat isn't a scalar (a nested dictionary or a list) is written as JSON.</p>": "<p>ํค๊ฐ ์๋ก ๋ค๋ฅธ ํญ๋ชฉ๋ ๊ธฐ๋กํฉ๋๋ค. ์๋ ๊ฐ์ ์ ์ ๋น์ ๋๊ณ , ์ค์นผ๋ผ๊ฐ ์๋ ๊ฐ(์ค์ฒฉ ๋์ ๋๋ฆฌ๋ ๋ชฉ๋ก)์ JSON์ผ๋ก ๊ธฐ๋กํฉ๋๋ค.</p>",+ "<p>The columns to write, defaulting to every key found in the items, in the order they appeared</p>": "<p>๊ธฐ๋กํ ์ด์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ํญ๋ชฉ์์ ์ฐพ์ ๋ชจ๋ ํค๋ฅผ ์ฒ์ ๋์จ ์์๋๋ก ์ฌ์ฉํฉ๋๋ค.</p>",+ "<p>The character separating the columns</p>": "<p>์ด์ ๊ตฌ๋ถํ๋ ๋ฌธ์์ ๋๋ค.</p>",+ "<p>Export items to an XML file.</p>": "<p>ํญ๋ชฉ์ XML ํ์ผ๋ก ๋ด๋ณด๋ ๋๋ค.</p>",+ "<p>Each item becomes an element whose children are named after the item's keys. Keys that aren't valid XML\nnames are rewritten and keep the original in a <code>name</code> attribute, and any value that isn't a scalar\n(a nested dictionary or a list) is written as JSON.</p>": "<p>๊ฐ ํญ๋ชฉ์ ํ๋์ ์์๊ฐ ๋๋ฉฐ ์์ ์์์ ์ด๋ฆ์ ํญ๋ชฉ์ ํค๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ ํจํ XML ์ด๋ฆ์ด ์๋ ํค๋ ๋ฐ๊พธ๊ณ ์๋ ํค๋ฅผ <code>name</code> ์์ฑ์ ์ ์ฅํฉ๋๋ค. ์ค์นผ๋ผ๊ฐ ์๋ ๊ฐ(์ค์ฒฉ ๋์ ๋๋ฆฌ๋ ๋ชฉ๋ก)์ JSON์ผ๋ก ๊ธฐ๋กํฉ๋๋ค.</p>",+ "<p>The name of the element wrapping all the items</p>": "<p>๋ชจ๋ ํญ๋ชฉ์ ๊ฐ์ธ๋ ์์์ ์ด๋ฆ์ ๋๋ค.</p>",+ "<p>The name of the element wrapping every item</p>": "<p>๊ฐ ํญ๋ชฉ์ ๊ฐ์ธ๋ ์์์ ์ด๋ฆ์ ๋๋ค.</p>",+ "<p>Pretty-print the file instead of writing it on a single line</p>": "<p>ํ์ผ์ ํ ์ค๋ก ์ฐ์ง ์๊ณ ์ฝ๊ธฐ ์ฝ๊ฒ ์์์ ์ง์ ํฉ๋๋ค.</p>",+ "<p>Manages pre-configured session instances.</p>": "<p>๋ฏธ๋ฆฌ ์ค์ ํ ์ธ์ ์ธ์คํด์ค๋ฅผ ๊ด๋ฆฌํฉ๋๋ค.</p>",+ "<p>Register a session instance.</p>": "<p>์ธ์ ์ธ์คํด์ค๋ฅผ ๋ฑ๋กํฉ๋๋ค.</p>",+ "<p>Name to reference this session in requests</p>": "<p>์์ฒญ์์ ์ด ์ธ์ ์ ์ฐธ์กฐํ ์ด๋ฆ์ ๋๋ค.</p>",+ "<p>Your pre-configured session instance</p>": "<p>๋ฏธ๋ฆฌ ์ค์ ํ ์ธ์ ์ธ์คํด์ค์ ๋๋ค.</p>",+ "<p>If True, this becomes the default session</p>": "<p>True์ด๋ฉด ๊ธฐ๋ณธ ์ธ์ ์ด ๋ฉ๋๋ค.</p>",+ "<p>If True, the session will be started only when a request uses its ID.</p>": "<p>True์ด๋ฉด ์์ฒญ์ด ์ด ์ธ์ ์ ID๋ฅผ ์ฌ์ฉํ ๋๋ง ์ธ์ ์ ์์ํฉ๋๋ค.</p>",+ "<p>Removes a session.</p>": "<p>์ธ์ ์ ์ ๊ฑฐํฉ๋๋ค.</p>",+ "<p>ID of session to remove</p>": "<p>์ ๊ฑฐํ ์ธ์ ์ ID์ ๋๋ค.</p>",+ "<p>Remove and returns a session.</p>": "<p>์ธ์ ์ ์ ๊ฑฐํ๊ณ ๋ฐํํฉ๋๋ค.</p>",+ "<p>Start all sessions that aren't already alive.</p>": "<p>์์ง ์คํ ์ค์ด์ง ์์ ๋ชจ๋ ์ธ์ ์ ์์ํฉ๋๋ค.</p>",+ "<p>Close all registered sessions.</p>": "<p>๋ฑ๋ก๋ ๋ชจ๋ ์ธ์ ์ ๋ซ์ต๋๋ค.</p>",+ "<p>Check if a session ID is registered.</p>": "<p>์ธ์ ID๊ฐ ๋ฑ๋ก๋์ด ์๋์ง ํ์ธํฉ๋๋ค.</p>",+ "<p>Number of registered sessions.</p>": "<p>๋ฑ๋ก๋ ์ธ์ ์ ์์ ๋๋ค.</p>"+} %}+{% macro translate(value) %}+ {% set result = namespace(html=value | replace("Bases:", "๊ธฐ๋ฐ ํด๋์ค:")) %}+ {% for source, target in translations.items() %}+ {% set result.html = result.html | replace(source, target | safe) %}+ {% endfor %}+ {{ result.html | safe }}+{% endmacro %}diff --git a/zensical-base.yml b/zensical-base.ymlindex 75a9d52..77572d7 100644--- a/zensical-base.yml+++ b/zensical-base.yml@@ -141,6 +141,9 @@ extra:- name: ะ ัััะบะธะนlink: https://scrapling.readthedocs.io/en/latest/ru/lang: ru+ - name: ํ๊ตญ์ด+ link: https://scrapling.readthedocs.io/en/latest/ko/+ lang: kowatch:- zensical-base.yml- docs/assetsdiff --git a/zensical.ko.yml b/zensical.ko.ymlnew file mode 100644index 0000000..41b80e8--- /dev/null+++ b/zensical.ko.yml@@ -0,0 +1,99 @@+INHERIT: zensical-base.yml+site_description: Scrapling - ํ๋์ ์ธ ์น์ ๊ฐํธํ๊ฒ ์คํฌ๋ํํ์ธ์!+site_url: https://scrapling.readthedocs.io/en/latest/ko/+docs_dir: docs/locales/ko+site_dir: site/ko+edit_uri: edit/main/docs/locales/ko/+copyright: Copyright © 2025 Karim Shoair - <a href="#__consent">์ฟ ํค ์ค์ ๋ณ๊ฒฝ</a>+nav:+- ์๊ฐ: index.md+- ์์ํ๊ธฐ: overview.md+- ์ฑ๋ฅ ํ ์คํธ: benchmarks.md+- ์ฌ์ฉ ๊ฐ์ด๋:+ - ํ์ด์ง ํ์ฑ:+ - ์์ ์ฐพ๊ธฐ: parsing/selection.md+ - ์ฃผ์ ํด๋์ค: parsing/main_classes.md+ - ์ ์ํ ์คํฌ๋ํ: parsing/adaptive.md+ - ํ์ด์ง ๊ฐ์ ธ์ค๊ธฐ:+ - Fetcher ์ ํ: fetching/choosing.md+ - HTTP ์์ฒญ: fetching/static.md+ - ๋ธ๋ผ์ฐ์ ๋ก ๊ฐ์ ธ์ค๊ธฐ: fetching/stealthy.md+ - ์คํ์ด๋:+ - ๊ตฌ์กฐ: spiders/architecture.md+ - ์ฒซ ์คํ์ด๋: spiders/getting-started.md+ - ์์ฒญ๊ณผ ์๋ต: spiders/requests-responses.md+ - ์ธ์ : spiders/sessions.md+ - ํ๋ก์์ ์ฐจ๋จ ์ฒ๋ฆฌ: spiders/proxy-blocking.md+ - ๋ฒ์ฉ ํ ํ๋ฆฟ: spiders/generic-templates.md+ - ํ๋ซํผ๋ณ ํ ํ๋ฆฟ: spiders/platform-templates.md+ - ๊ณ ๊ธ ๊ธฐ๋ฅ: spiders/advanced.md+ - ๋ช ๋ น์ค:+ - ๊ฐ์: cli/overview.md+ - ๋ํํ ์ ธ: cli/interactive-shell.md+ - ์ถ์ถ ๋ช ๋ น์ด: cli/extract-commands.md+ - AI ์ฐ๋:+ - MCP ์๋ฒ: ai/mcp-server.md+ - Agent Skill: ai/agent-skill.md+ - RAG ์์คํ ๋ง๋ค๊ธฐ: ai/building-rag-systems.md+ - ์ฐ๋๊ณผ ์ ํ:+ - Scrapy ์ฐ๋: integrations/scrapy.md+ - BeautifulSoup์์ ์ฎ๊ธฐ๊ธฐ: tutorials/migrating_from_beautifulsoup.md+- ๋ฐ๋ผ ํ๊ธฐ:+ - AI ์คํฌ๋ํ ์๋น์ค์ ๋ฌด๋ฃ ๋์: tutorials/replacing_ai.md+- ๊ฐ๋ฐ:+ - API ์ฐธ๊ณ ๋ฌธ์:+ - Selector: api-reference/selector.md+ - Fetcher: api-reference/fetchers.md+ - MCP ์๋ฒ: api-reference/mcp-server.md+ - ์ฌ์ฉ์ ์ ์ ์๋ฃํ: api-reference/custom-types.md+ - Response: api-reference/response.md+ - Spider: api-reference/spiders.md+ - ํ๋ก์ ๊ต์ฒด: api-reference/proxy-rotation.md+ - ์ง์ ์ ์ฅ ์์คํ ๋ง๋ค๊ธฐ: development/adaptive_storage_system.md+ - Scrapling ์๋ฃํ ์ฌ์ฉํ๊ธฐ: development/scrapling_custom_types.md+- ํ์๊ณผ ๊ด๊ณ : donate.md+- ๊ฐ๋ฐ์ ์ฐธ์ฌํ๊ธฐ: https://github.com/D4Vinci/Scrapling/blob/main/CONTRIBUTING.md+- ๋ณ๊ฒฝ ๊ธฐ๋ก: https://github.com/D4Vinci/Scrapling/blob/main/CHANGELOG.md+theme:+ language: ko+ palette:+ - media: '(prefers-color-scheme: light)'+ scheme: default+ accent: green+ primary: deep purple+ toggle:+ icon: lucide/sun+ name: ์ด๋์ด ํ ๋ง๋ก ์ ํ+ - media: '(prefers-color-scheme: dark)'+ scheme: slate+ accent: light green+ primary: deep purple+ toggle:+ icon: lucide/moon+ name: ๋ฐ์ ํ ๋ง๋ก ์ ํ+markdown_extensions:+ toc:+ permalink_title: ์ด ์ ๋ชฉ์ผ๋ก ์ฐ๊ฒฐ๋๋ ๋งํฌ+plugins:+ mkdocstrings:+ locale: ko+extra:+ analytics:+ feedback:+ title: ์ด ํ์ด์ง๊ฐ ๋์์ด ๋์๋์?+ ratings:+ - icon: material/heart+ name: ๋์์ด ๋์์ต๋๋ค+ data: 1+ note: ์๊ฒฌ์ ๋ณด๋ด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!+ - icon: material/heart-broken+ name: ๊ฐ์ ์ด ํ์ํฉ๋๋ค+ data: 0+ note: '์๊ฒฌ์ ๋ณด๋ด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. <a href="https://github.com/D4Vinci/Scrapling/issues/new?template=04-docs_issue.yml" target="_blank" rel="noopener">๋ฌธ์์ ๋ฌธ์ ๋ฅผ ์๋ ค ์ฃผ์๋ฉด</a> ๊ฐ์ ํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.'+ consent:+ title: ์ฟ ํค ์ฌ์ฉ ์๋ด+ description: ์ค์ ์ ๊ธฐ์ตํ๊ณ ๋ฌธ์๊ฐ ์ผ๋ง๋ ๋์์ด ๋๋์ง ํ์ธํ๊ธฐ ์ํด ์ฟ ํค๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋์ํด ์ฃผ์๋ฉด ๋ฌธ์๋ฅผ ๊ฐ์ ํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.+ actions:+ - accept+ - reject+ - manage