diff options
author | Matt Lyon <matthewlyon18@gmail.com> | 2020-09-09 12:26:33 +0100 |
---|---|---|
committer | Matt Lyon <matthewlyon18@gmail.com> | 2020-09-09 12:26:33 +0100 |
commit | 4e2d04eca0147396092d2163bd8706fe497a8bf1 (patch) | |
tree | d401230004fba97c37abf71c93f4b3c9078f33b0 /tpblite/models | |
parent | 1ad2946a5ff0902c8a028b7caec67037b8e61ce3 (diff) | |
download | tpb-lite-4e2d04eca0147396092d2163bd8706fe497a8bf1.tar.gz tpb-lite-4e2d04eca0147396092d2163bd8706fe497a8bf1.tar.bz2 tpb-lite-4e2d04eca0147396092d2163bd8706fe497a8bf1.zip |
added tests, switched to lxml
Diffstat (limited to 'tpblite/models')
-rw-r--r-- | tpblite/models/torrents.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py index 1c2b32d..4803740 100644 --- a/tpblite/models/torrents.py +++ b/tpblite/models/torrents.py @@ -1,7 +1,5 @@ import unicodedata -from lxml.etree import HTML - -# TODO: write better comments +import lxml.etree as ET def fileSizeStrToInt(size_str): @@ -97,7 +95,7 @@ class Torrents: return self.list[index] def _createTorrentList(self): - root = HTML(self.html_source) + root = ET.HTML(self.html_source) if root.find("body") is None: raise ConnectionError("Could not determine torrents (empty html body)") rows = root.xpath('//tr[td[@class="vertTh"]]') |