<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>https://smwiki.info/index.php?action=history&amp;feed=atom&amp;title=%EB%8D%B0%EC%9D%B4%ED%84%B0_%ED%81%AC%EB%A1%A4%EB%A7%81</id>
	<title>데이터 크롤링 - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="https://smwiki.info/index.php?action=history&amp;feed=atom&amp;title=%EB%8D%B0%EC%9D%B4%ED%84%B0_%ED%81%AC%EB%A1%A4%EB%A7%81"/>
	<link rel="alternate" type="text/html" href="https://smwiki.info/index.php?title=%EB%8D%B0%EC%9D%B4%ED%84%B0_%ED%81%AC%EB%A1%A4%EB%A7%81&amp;action=history"/>
	<updated>2026-05-13T15:11:38Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://smwiki.info/index.php?title=%EB%8D%B0%EC%9D%B4%ED%84%B0_%ED%81%AC%EB%A1%A4%EB%A7%81&amp;diff=3551&amp;oldid=prev</id>
		<title>Sam: 새 문서: &lt;br /&gt; ===기본 방법=== {| class=&quot;wikitable&quot; |+ !과정 !설명 !방법 |- |url 열기 |url 문서를 연다. 뷰티플 스프를 불러오는 과정에 유의하자. |&lt;syntaxhighl...</title>
		<link rel="alternate" type="text/html" href="https://smwiki.info/index.php?title=%EB%8D%B0%EC%9D%B4%ED%84%B0_%ED%81%AC%EB%A1%A4%EB%A7%81&amp;diff=3551&amp;oldid=prev"/>
		<updated>2021-03-24T02:34:01Z</updated>

		<summary type="html">&lt;p&gt;새 문서: &amp;lt;br /&amp;gt; ===기본 방법=== {| class=&amp;quot;wikitable&amp;quot; |+ !과정 !설명 !방법 |- |url 열기 |url 문서를 연다. 뷰티플 스프를 불러오는 과정에 유의하자. |&amp;lt;syntaxhighl...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===기본 방법===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!과정&lt;br /&gt;
!설명&lt;br /&gt;
!방법&lt;br /&gt;
|-&lt;br /&gt;
|url 열기&lt;br /&gt;
|url 문서를 연다.&lt;br /&gt;
뷰티플 스프를 불러오는 과정에 유의하자.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from bs4 import BeautifulSoup&lt;br /&gt;
from urllib.request import urlopen&lt;br /&gt;
&lt;br /&gt;
with urlopen(url) as 문서:  # 이처럼 열어 사용한다. with을 사용하면 save()를 따로 할 필요가 없다.&lt;br /&gt;
    명령&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|BeautifulSoup와 연결&lt;br /&gt;
|특정 html 문서를 파서와 연결한다.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
html = BeautifulSoup(문서, lxml)  # 파서 라이브러리를 lxml로 지정해 사용한다.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|태그 찾기&lt;br /&gt;
|위 명령 부분에 작성한다.&lt;br /&gt;
find_all() 혹은 find() 사용.&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
내용 = html.find(&amp;#039;찾을태그&amp;#039;, class_=&amp;#039;찾을클래스&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;find()는 가장 위에 있는 것 하나만 찾는다.&lt;br /&gt;
find_all()은 결과를 리스트로 반환한다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
옵션에서 class 대신 class_를 사용하는 것은 파이썬 내부에 class라는 명령이 있기 때문이다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
찾아내면 태그를 통째로 가져오는데, 택스트만 추출하려면 여기에 다시 .text 로 텍스트 속성에 접근해야 한다.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
[[분류:파이썬:데이터 스크롤링]]&lt;/div&gt;</summary>
		<author><name>Sam</name></author>
	</entry>
</feed>