| 1 |
Metadata-Version: 2.4 |
| 2 |
Name: beautifulsoup4 |
| 3 |
Version: 4.15.0 |
| 4 |
Summary: Screen-scraping library |
| 5 |
Project-URL: Download, https://www.crummy.com/software/BeautifulSoup/bs4/download/ |
| 6 |
Project-URL: Homepage, https://www.crummy.com/software/BeautifulSoup/bs4/ |
| 7 |
Author-email: Leonard Richardson <[email protected]> |
| 8 |
License: MIT License |
| 9 |
License-File: AUTHORS |
| 10 |
License-File: LICENSE |
| 11 |
Keywords: HTML,XML,parse,soup |
| 12 |
Classifier: Development Status :: 5 - Production/Stable |
| 13 |
Classifier: Intended Audience :: Developers |
| 14 |
Classifier: License :: OSI Approved :: MIT License |
| 15 |
Classifier: Programming Language :: Python |
| 16 |
Classifier: Programming Language :: Python :: 3 |
| 17 |
Classifier: Topic :: Software Development :: Libraries :: Python Modules |
| 18 |
Classifier: Topic :: Text Processing :: Markup :: HTML |
| 19 |
Classifier: Topic :: Text Processing :: Markup :: SGML |
| 20 |
Classifier: Topic :: Text Processing :: Markup :: XML |
| 21 |
Requires-Python: >=3.7.0 |
| 22 |
Requires-Dist: soupsieve>=1.6.1 |
| 23 |
Requires-Dist: typing-extensions>=4.0.0 |
| 24 |
Provides-Extra: cchardet |
| 25 |
Requires-Dist: cchardet; extra == 'cchardet' |
| 26 |
Provides-Extra: chardet |
| 27 |
Requires-Dist: chardet; extra == 'chardet' |
| 28 |
Provides-Extra: charset-normalizer |
| 29 |
Requires-Dist: charset-normalizer; extra == 'charset-normalizer' |
| 30 |
Provides-Extra: html5lib |
| 31 |
Requires-Dist: html5lib; extra == 'html5lib' |
| 32 |
Provides-Extra: lxml |
| 33 |
Requires-Dist: lxml; extra == 'lxml' |
| 34 |
Description-Content-Type: text/markdown |
| 35 |
|
| 36 |
Beautiful Soup is a library that makes it easy to scrape information |
| 37 |
from web pages. It sits atop an HTML or XML parser, providing Pythonic |
| 38 |
idioms for iterating, searching, and modifying the parse tree. |
| 39 |
|
| 40 |
# Quick start |
| 41 |
|
| 42 |
``` |
| 43 |
>>> from bs4 import BeautifulSoup |
| 44 |
>>> soup = BeautifulSoup("<p>Some<b>bad<i>HTML") |
| 45 |
>>> print(soup.prettify()) |
| 46 |
<html> |
| 47 |
<body> |
| 48 |
<p> |
| 49 |
Some |
| 50 |
<b> |
| 51 |
bad |
| 52 |
<i> |
| 53 |
HTML |
| 54 |
</i> |
| 55 |
</b> |
| 56 |
</p> |
| 57 |
</body> |
| 58 |
</html> |
| 59 |
>>> soup.find(string="bad") |
| 60 |
'bad' |
| 61 |
>>> soup.i |
| 62 |
<i>HTML</i> |
| 63 |
# |
| 64 |
>>> soup = BeautifulSoup("<tag1>Some<tag2/>bad<tag3>XML", "xml") |
| 65 |
# |
| 66 |
>>> print(soup.prettify()) |
| 67 |
<?xml version="1.0" encoding="utf-8"?> |
| 68 |
<tag1> |
| 69 |
Some |
| 70 |
<tag2/> |
| 71 |
bad |
| 72 |
<tag3> |
| 73 |
XML |
| 74 |
</tag3> |
| 75 |
</tag1> |
| 76 |
``` |
| 77 |
|
| 78 |
To go beyond the basics, [comprehensive documentation is available](https://www.crummy.com/software/BeautifulSoup/bs4/doc/). |
| 79 |
|
| 80 |
# Links |
| 81 |
|
| 82 |
* [Homepage](https://www.crummy.com/software/BeautifulSoup/bs4/) |
| 83 |
* [Documentation](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) |
| 84 |
* [Discussion group](https://groups.google.com/group/beautifulsoup/) |
| 85 |
* [Development](https://code.launchpad.net/beautifulsoup/) |
| 86 |
* [Bug tracker](https://bugs.launchpad.net/beautifulsoup/) |
| 87 |
* [Complete changelog](https://git.launchpad.net/beautifulsoup/tree/CHANGELOG) |
| 88 |
|
| 89 |
# Note on Python 2 sunsetting |
| 90 |
|
| 91 |
Beautiful Soup's support for Python 2 was discontinued on December 31, |
| 92 |
2020: one year after the sunset date for Python 2 itself. From this |
| 93 |
point onward, new Beautiful Soup development will exclusively target |
| 94 |
Python 3. The final release of Beautiful Soup 4 to support Python 2 |
| 95 |
was 4.9.3. |
| 96 |
|
| 97 |
# Supporting the project |
| 98 |
|
| 99 |
If you use Beautiful Soup as part of your professional work, please consider a |
| 100 |
[Tidelift subscription](https://tidelift.com/subscription/pkg/pypi-beautifulsoup4?utm_source=pypi-beautifulsoup4&utm_medium=referral&utm_campaign=readme). |
| 101 |
This will support many of the free software projects your organization |
| 102 |
depends on, not just Beautiful Soup. |
| 103 |
|
| 104 |
If you use Beautiful Soup for personal projects, the best way to say |
| 105 |
thank you is to read |
| 106 |
[Tool Safety](https://www.crummy.com/software/BeautifulSoup/zine/), a zine I |
| 107 |
wrote about what Beautiful Soup has taught me about software |
| 108 |
development. |
| 109 |
|
| 110 |
# Building the documentation |
| 111 |
|
| 112 |
The bs4/doc/ directory contains full documentation in Sphinx |
| 113 |
format. Run `make html` in that directory to create HTML |
| 114 |
documentation. |
| 115 |
|
| 116 |
# Running the unit tests |
| 117 |
|
| 118 |
Beautiful Soup supports unit test discovery using Pytest: |
| 119 |
|
| 120 |
``` |
| 121 |
$ pytest |
| 122 |
``` |
| 123 |
|