๐ ํ์ด์ฌ (Python)/-- ์น ํฌ๋กค๋ง (web crawling)
-
* ํฌ๋กค๋ง (crawling) ์กฐ์ง์ , ์๋ํ๋ ๋ฐฉ๋ฒ์ ํตํ์ฌ ์น์ ํ์ํ๋ ์ปดํจํฐ ํ๋ก๊ทธ๋จ์ ํฌ๋กค๋ฌ(crawler)๋ผ๊ณ ํ๋ค. ๋ฐ๋ผ์ ํฌ๋กค๋ง์ , ํฌ๋กค๋ฌ๊ฐ ํน์ ๊ท์น์ ๊ฐ์ง๊ณ ์ฌ๋ฌ ์ฌ์ดํธ์ ํ์ด์ง๋ฅผ ํ์ํ๋ฉฐ ์์งํ๊ณ ๋ถ๋ฅํ๋๊ฒ์ ๋งํ๋ค. ํฌ๋กค๋ง๋ ์คํฌ๋ํ์ ์ผ์ข ์ด๋ค(์คํฌ๋ํ์ด ๋ ํฐ๋ฒ์๋ฅผ ํฌํจํ๋ ์๋ฏธ) * ์คํฌ๋ํ (scraping) ์น์ผ๋ก ํน์ ์ง์ง ์์ผ๋ฉฐ, ๋ชจ๋ ์์ค๋ก๋ถํฐ ํ์ํ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๊ณ , ์ํ๋ ํํ๋ก ๊ฐ๊ณตํ๋ ๊ฒ์ ๋งํ๋ค. ๋ฐ๋ผ์ ํฌ๋กค๋ง๊ณผ ๋น์ทํ ์๋ฏธ์ด๋ฉฐ ๊ตฌ๋ถํ๊ธฐ ์ด๋ ต์ง๋ง ์คํฌ๋ํ์ด ๋ ํฐ ๋ฒ์๋ฅผ ๊ฐ์ง๋ฉฐ, ํฌ๋กค๋ง๋ ์คํฌ๋ํ์ ํฌํจ๋๋ ๋จ์ด๋ผ๊ณ ํ๋ค. * ํฌ๋กค๋ง์์ ์ฃผ์ํ ๊ฒ ์๋ฒ(server)์ ์ ์ฑ ์ด ํ์ฉํ๋ ๋ฒ์ ๋ด์์๋ง ์ด๋ฃจ์ด์ ธ์ผ ํ๋ค. ( ํฌ๋กค๋ง์์ ์๋ฒ์ ๋ฐ์๋๋ ๋ถํ ๋ผ๋๊ฐ(..
ํฌ๋กค๋ง , ์คํฌ๋ฉํ ์ด๋ ? ( robots.txt ์ ๋ป)* ํฌ๋กค๋ง (crawling) ์กฐ์ง์ , ์๋ํ๋ ๋ฐฉ๋ฒ์ ํตํ์ฌ ์น์ ํ์ํ๋ ์ปดํจํฐ ํ๋ก๊ทธ๋จ์ ํฌ๋กค๋ฌ(crawler)๋ผ๊ณ ํ๋ค. ๋ฐ๋ผ์ ํฌ๋กค๋ง์ , ํฌ๋กค๋ฌ๊ฐ ํน์ ๊ท์น์ ๊ฐ์ง๊ณ ์ฌ๋ฌ ์ฌ์ดํธ์ ํ์ด์ง๋ฅผ ํ์ํ๋ฉฐ ์์งํ๊ณ ๋ถ๋ฅํ๋๊ฒ์ ๋งํ๋ค. ํฌ๋กค๋ง๋ ์คํฌ๋ํ์ ์ผ์ข ์ด๋ค(์คํฌ๋ํ์ด ๋ ํฐ๋ฒ์๋ฅผ ํฌํจํ๋ ์๋ฏธ) * ์คํฌ๋ํ (scraping) ์น์ผ๋ก ํน์ ์ง์ง ์์ผ๋ฉฐ, ๋ชจ๋ ์์ค๋ก๋ถํฐ ํ์ํ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๊ณ , ์ํ๋ ํํ๋ก ๊ฐ๊ณตํ๋ ๊ฒ์ ๋งํ๋ค. ๋ฐ๋ผ์ ํฌ๋กค๋ง๊ณผ ๋น์ทํ ์๋ฏธ์ด๋ฉฐ ๊ตฌ๋ถํ๊ธฐ ์ด๋ ต์ง๋ง ์คํฌ๋ํ์ด ๋ ํฐ ๋ฒ์๋ฅผ ๊ฐ์ง๋ฉฐ, ํฌ๋กค๋ง๋ ์คํฌ๋ํ์ ํฌํจ๋๋ ๋จ์ด๋ผ๊ณ ํ๋ค. * ํฌ๋กค๋ง์์ ์ฃผ์ํ ๊ฒ ์๋ฒ(server)์ ์ ์ฑ ์ด ํ์ฉํ๋ ๋ฒ์ ๋ด์์๋ง ์ด๋ฃจ์ด์ ธ์ผ ํ๋ค. ( ํฌ๋กค๋ง์์ ์๋ฒ์ ๋ฐ์๋๋ ๋ถํ ๋ผ๋๊ฐ(..
2020.05.26 -
https://docs.python.org/ko/3/library/urllib.request.html#module-urllib.request urllib.request โ Extensible library for opening URLs โ Python 3.8.2 ๋ฌธ์ urllib.request โ Extensible library for opening URLs Source code: Lib/urllib/request.py The urllib.request module defines functions and classes which help in opening URLs (mostly HTTP) in a complex world โ basic and digest authentication, redirecti..
ํ์ด์ฌ ํฌ๋กค๋ง (Python crawling) - urllib ๋ก ์ด๋ฏธ์ง , html ๋ฌธ์ ๋ค์ด๋ฐ๊ธฐ.https://docs.python.org/ko/3/library/urllib.request.html#module-urllib.request urllib.request โ Extensible library for opening URLs โ Python 3.8.2 ๋ฌธ์ urllib.request โ Extensible library for opening URLs Source code: Lib/urllib/request.py The urllib.request module defines functions and classes which help in opening URLs (mostly HTTP) in a complex world โ basic and digest authentication, redirecti..
2020.02.26