We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f03464c + ae65cd6 commit 006f5cfCopy full SHA for 006f5cf
1 file changed
microdata.py
@@ -11,19 +11,14 @@
11
import simplejson as json
12
13
14
-def get_items(location, encoding='UTF-8'):
+def get_items(location, encoding=None):
15
"""
16
- Pass in a file or file-like object and get a list of Items present in the
+ Pass in a string or file-like object and get a list of Items present in the
17
HTML document.
18
19
dom_builder = html5lib.treebuilders.getTreeBuilder("dom")
20
parser = html5lib.HTMLParser(tree=dom_builder)
21
-
22
- if (sys.version_info.major == 3):
23
- tree = parser.parse(location)
24
- else:
25
- tree = parser.parse(location, encoding=encoding)
26
+ tree = parser.parse(location, encoding=encoding)
27
return _find_items(tree)
28
29
0 commit comments