Skip to content

Commit 17f9dba

Browse files
committed
Remove the long-deprecated BeautifulSoup support.
As has been stated before, this was deprecated due to lack of namespace support, hence making it impossible for it to represent any tree containing foreign content.
1 parent 4834f64 commit 17f9dba

File tree

7 files changed

+3
-325
lines changed

7 files changed

+3
-325
lines changed

html5lib/tests/support.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@
4848
except ImportError:
4949
pass
5050

51-
try:
52-
import BeautifulSoup
53-
treeTypes["beautifulsoup"] = treebuilders.getTreeBuilder("beautifulsoup", fullTree=True)
54-
except ImportError:
55-
pass
56-
5751
def get_data_files(subdirectory, files='*.dat'):
5852
return glob.glob(os.path.join(test_dir,subdirectory,files))
5953

html5lib/tests/test_treewalkers.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ def PullDOMAdapter(node):
9393
"walker": treewalkers.getTreeWalker("lxml")}
9494
except ImportError:
9595
pass
96-
97-
try:
98-
import BeautifulSoup
99-
treeTypes["beautifulsoup"] = \
100-
{"builder": treebuilders.getTreeBuilder("beautifulsoup"),
101-
"walker": treewalkers.getTreeWalker("beautifulsoup")}
102-
except ImportError:
103-
pass
10496

10597
#Try whatever etree implementations are available from a list that are
10698
#"supposed" to work

html5lib/treebuilders/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
4040
"""Get a TreeBuilder class for various types of tree with built-in support
4141
4242
treeType - the name of the tree type required (case-insensitive). Supported
43-
values are "simpletree", "dom", "etree" and "beautifulsoup"
43+
values are "simpletree", "dom", and "etree"
4444
4545
"simpletree" - a built-in DOM-ish tree type with support for some
4646
more pythonic idioms.
@@ -51,7 +51,6 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
5151
"etree" - A generic builder for tree implementations exposing an
5252
elementtree-like interface (known to work with
5353
ElementTree, cElementTree and lxml.etree).
54-
"beautifulsoup" - Beautiful soup (if installed)
5554
5655
implementation - (Currently applies to the "etree" and "dom" tree types). A
5756
module implementing the tree type e.g.
@@ -70,9 +69,6 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
7069
elif treeType == "simpletree":
7170
from . import simpletree
7271
treeBuilderCache[treeType] = simpletree.TreeBuilder
73-
elif treeType == "beautifulsoup":
74-
from . import soup
75-
treeBuilderCache[treeType] = soup.TreeBuilder
7672
elif treeType == "lxml":
7773
from . import etree_lxml
7874
treeBuilderCache[treeType] = etree_lxml.TreeBuilder

html5lib/treebuilders/soup.py

Lines changed: 0 additions & 238 deletions
This file was deleted.

html5lib/treewalkers/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
1818
"""Get a TreeWalker class for various types of tree with built-in support
1919
2020
treeType - the name of the tree type required (case-insensitive). Supported
21-
values are "simpletree", "dom", "etree" and "beautifulsoup"
21+
values are "simpletree", "dom", and "etree"
2222
2323
"simpletree" - a built-in DOM-ish tree type with support for some
2424
more pythonic idioms.
@@ -28,7 +28,6 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
2828
elementtree-like interface (known to work with
2929
ElementTree, cElementTree and lxml.etree).
3030
"lxml" - Optimized walker for lxml.etree
31-
"beautifulsoup" - Beautiful soup (if installed)
3231
"genshi" - a Genshi stream
3332
3433
implementation - (Currently applies to the "etree" tree type only). A module
@@ -45,9 +44,6 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
4544
elif treeType == "genshi":
4645
from . import genshistream
4746
treeWalkerCache[treeType] = genshistream.TreeWalker
48-
elif treeType == "beautifulsoup":
49-
from . import soup
50-
treeWalkerCache[treeType] = soup.TreeWalker
5147
elif treeType == "lxml":
5248
from . import lxmletree
5349
treeWalkerCache[treeType] = lxmletree.TreeWalker

html5lib/treewalkers/soup.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
with the behaviour of major desktop web browsers.
88
99
Output is to a tree structure; the current release supports output to
10-
DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a
10+
DOM, ElementTree, and lxml tree formats as well as a
1111
simple custom format"""
1212

1313
classifiers=[

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy