数据采集中HTML常见标签及属性如下:
标签 | 说明 | 举个栗子 |
---|---|---|
html | html文档 | <html class="" lang="zh\-cmn\-Hans"> |
head | 头部 | |
title | 文档标题 | |
body | 文档主体 | |
h1 | 标题 | " |
豆瓣电影 Top 250 | ||
" | ||
p | 段落 | " <p class=""""> |
导演: 弗兰克·德拉邦特 Frank Darabont 主演: 蒂姆·罗宾斯 Tim Robbins | ||
1994 / 美国 / 犯罪 剧情 | ||
" | ||
br | 换行 | |
hr | 水平线 | |
a | 锚 | " <a class="“nav-login”" href="“https://accounts.douban.com/passport/login?source=movie”" rel="“nofollow”"> |
登录/注册 | ||
" | ||
link | 外部链接 | |
nav | 导航链接 | |
b | 粗体字 | |
abbr | 缩写 | |
cite | 引用citation | |
blockquote | 长引用 | |
q | 短引用 | " <p class="“qrcode”"> |
扫码直接下载 | ||
" | ||
fieldset | ||
meta | <meta content=“text/html; charset=utf-8” http-equiv=“Content-Type”/> | |
script | " <script type="“text/javascript”"> | |
var _body_start = new Date(); | ||
" | ||
em | 强调文本 | " <em class=""""> |
1 | ||
" | ||
节 | ||
style | 文档样式 | " <style type="“text/css”"> |
img { max-width: 100%; } | ||
" | ||
div | 文档的节 | |
span | 文档的节 | 更多 |
section | 区域 | |
article | 文章 | |
details | 元素细节 | |
dialog | 对话框 | |
多媒体 | ||
img | 图像 | ![]() |
audio | 声音 | |
source | 媒介源 | |
表单 | ||
form | 供输入的表单 | |
input | 文本框 | |
框架 | ||
iframe | 内联框架 | |
frame | 框架集的窗口或框架 | |
列表 | ||
ul | 无序列表 | |
ol | 有序列表 | |
li | 列表项目 | " <li class="“on”"> |
电影 | ||
" | ||
表格 | ||
table | 表格 |
|
caption | 表格标题 | |
th | 表头单元格 | |
tr | 表格行 | |
td | 表格单元 | |
thead | 表头内容 | |
tbody | 表格主体内容 | |
col | 一列或多列的属性值 |