Skip to Content
Python 技術手冊 第三版
book

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
679
22
結構化文字:HTML
Web 上的大多數文件都使用 HTML,即 HyperText Markup Language(超
文件標示語言)。
Markup
標示
代表在文字文件(text document)中插
入特殊的記號(tokens),稱為
標記
tags
,以將文字結構化。HTML
在理論上,是大型、通用的標準SGMLStandard General Markup
Language)的一個應用。實務上,web 上的許多文件都是以草率或不正確
的方式使用 HTML。這些年來,瀏覽器演化出了試探法(heuristics)來彌
補這點,但即使是這樣,仍然會發生瀏覽器以怪異的方式顯示一個錯誤標
示(wrongly marked-up)的網頁的情形(如果是現代的瀏覽器,就別責備
它們:十之八九,該責怪的是那個網頁的作者)。
除了在瀏覽器中呈現文件以外,HTML
1
能做的不多。想要從文件呈現
出來的樣子往回推,完整且精確地擷取出文件中的資訊,很多時候並不
可行。為了讓事情有條理一點,HTML 試著演進為一個更嚴謹的標準,
叫做 XHTMLXHTML 類似傳統的 HTML,但它是以 XML 來定義的,
HTML 更為精確。你能以第 23 章中所涵蓋的工具來處理格式正確的
XHTML。然而,在本文寫作之時,XHTML 看起來並未取得壓到性的成
功,反而是被(非 XML 的)最新版本 HTML5 搶了風采。
儘管困難,通常還是可能至少從 HTML 文件擷取出一些實用的資訊(這
種任務被稱為
screen-scraping ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

利用 Python 进行数据分析(原书第2版)

利用 Python 进行数据分析(原书第2版)

Wes McKinney

Publisher Resources

ISBN: 9789864766819