<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Beautiful_Soup</id>
	<title>Beautiful Soup - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Beautiful_Soup"/>
	<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Beautiful_Soup&amp;action=history"/>
	<updated>2026-07-14T21:50:13Z</updated>
	<subtitle>在这个wiki上该页的修订历史</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://arolstar52-zhtest.hf.space/index.php?title=Beautiful_Soup&amp;diff=2844391&amp;oldid=prev</id>
		<title>imported&gt;Taeas：​维护清理</title>
		<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Beautiful_Soup&amp;diff=2844391&amp;oldid=prev"/>
		<updated>2023-08-01T12:41:42Z</updated>

		<summary type="html">&lt;p&gt;维护清理&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{NoteTA|G1=IT|G2=FL}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
|title=Beautiful Soup&lt;br /&gt;
|name=Beautiful Soup&lt;br /&gt;
|author=Leonard Richardson&lt;br /&gt;
|programming language=[[Python]]&lt;br /&gt;
|genre=[[HTML]]解析库、网络数据采集&lt;br /&gt;
|license=[[Python软件基金会许可证]] （Beautiful Soup 3及以前）&amp;lt;br /&amp;gt;[[MIT許可證]]（Beautiful 4及以后）&amp;lt;ref name=&amp;quot;crummy.com&amp;quot;&amp;gt;{{cite web|title=Beautiful Soup website|url=http://www.crummy.com/software/BeautifulSoup/#Download|accessdate=18 April 2012|quote=Beautiful Soup is licensed under the same terms as Python itself|archive-date=2017-02-03|archive-url=https://web.archive.org/web/20170203142857/https://www.crummy.com/software/BeautifulSoup/#Download|dead-url=yes}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|website={{URL|http://www.crummy.com/software/BeautifulSoup/}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Beautiful Soup&amp;#039;&amp;#039;&amp;#039;是一个[[Python]]包，功能包括解析[[HTML]]、[[XML]]文档、修复含有未闭合标签等错误的文档（此种文档常被称为tag soup）。这个扩展包为待解析的页面建立一棵[[树 (数据结构)|树]]，以便提取其中的数据，这在网络数据采集时非常有用。&amp;lt;ref name=&amp;quot;crummy.com&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在2021年，Python 2.7的官方支持终止，BeautifulSoup发行版4.9.3是支持Python 2.7的最后版本&amp;lt;ref&amp;gt;{{cite web |first1=Leonard |last1=Richardson |title=Beautiful Soup 4.10.0 |url=https://groups.google.com/g/beautifulsoup/c/flWqqlrcJ9s |website=beautifulsoup |publisher=Google Groups |access-date=27 September 2022 |date=7 Sep 2021 |archive-date=2022-09-29 |archive-url=https://web.archive.org/web/20220929102901/https://groups.google.com/g/beautifulsoup/c/flWqqlrcJ9s |dead-url=no }}&amp;lt;/ref&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
== 示例代码 ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
# Anchor extraction from HTML document&lt;br /&gt;
from bs4 import BeautifulSoup&lt;br /&gt;
from urllib.request import urlopen&lt;br /&gt;
with urlopen(&amp;#039;https://en.wikipedia.org/wiki/Main_Page&amp;#039;) as response:&lt;br /&gt;
    soup = BeautifulSoup(response, &amp;#039;html.parser&amp;#039;)&lt;br /&gt;
    for anchor in soup.find_all(&amp;#039;a&amp;#039;):&lt;br /&gt;
        print(anchor.get(&amp;#039;href&amp;#039;, &amp;#039;/&amp;#039;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 参见 ==&lt;br /&gt;
* [[HTML解析器对比]]&lt;br /&gt;
&lt;br /&gt;
== 参考资料 ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
{{Compu-lang-stub}}&lt;br /&gt;
[[Category:Python库]]&lt;br /&gt;
[[Category:使用MIT许可证的软件]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Taeas</name></author>
	</entry>
</feed>