[Python크롤링] 3. 크롤링에 필요한 HTML5와 CSS3
HTML5이란?
- 표준 웹이라고 부르는 HTML5은 주로 내용을 표현(Display)하는것에 중점을 두고 있습니다.
CSS3란?
- HTML문서에 있는 태그들을 시각적으로 꾸며주는 역할을 담당
HTML 요소
- 웹페이지 구조와 의미를 정의
- 시작태그와 끝태그로 컨텐츠를 감싼다.
- 요소에 컨텐츠에 대해 추가적인 정보를 제공 하려면 속성(Attribute)를 사용
HTML 태그
- h1
- p
- li
- strong
- img
- src 속성
- a
- href 속성
CSS 요소
- 특정 태그를 선택자로 정의하여 글씨체, 색, 크기등을 정의
CSS 사용방법
- HTML 태그에 style 속성 사용
<head>
태그에 style 태그 지정<link>
요소 사용
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style>
/* class 속성으로 select를 가지는 태그의 color속성을 red로 지정한다 */
.select {
color: red;
}
#myid {
color: blue;
}
h2 {
color: purple;
}
</style>
</head>
<body>
<ul>
<li class="select">Lorem ipsum</li>
<li>Lorem ipsum</li>
<li class="select">Lirem ipsum</li>
<li>Lorem ipsum</li>
</ul>
<p>
<strong>Elements</strong> consist of
<string>Content</string>
<em>Start</em> and <em>end</em> tag.
</p>
<h1 id="myid">Introduction to HTML</h1>
<h2>Start</h2>
<a href="http://www.google.com">Google</a>
</body>
</html>