Skip to content

Commit 8c6f802

Browse files
authored
Merge pull request #14 from yuanxu-li/issue-4_remove_unicode_checking_for_py3_comp
Fix py2/py3 unicode compatibility issue
2 parents 0222439 + d2e65dd commit 8c6f802

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

html_table_extractor/extractor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ def __init__(self, table, id_=None, **kwargs):
1212
# input is Tag
1313
if isinstance(table, Tag):
1414
self._table = table.find(id=id_)
15-
# input is str/unicode
16-
elif isinstance(table, str) or isinstance(table, unicode):
15+
# input is str
16+
# for py2, make sure you pass in str
17+
# for py3, everything is str by default
18+
elif isinstance(table, str):
1719
self._table = BeautifulSoup(table, 'html.parser').find(id=id_)
1820
else:
1921
raise Exception('unrecognized type')

0 commit comments

Comments
 (0)