Skip to content

Commit bb8e16d

Browse files
committed
Fixed bug with auctions with more than 10 charms failing to parse
1 parent d9b3072 commit bb8e16d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ Changelog
66
Due to this library relying on external content, older versions are not guaranteed to work.
77
Try to always use the latest version.
88

9+
.. v3.5.2:
10+
11+
3.5.2 (2020-09-22)
12+
==================
13+
14+
- Fixed bug with auctions with more than 10 charms failing to parse.
15+
916
.. v3.5.1:
1017
1118
3.5.1 (2020-09-22)

tibiapy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '3.5.1'
1+
__version__ = '3.5.2'
22
__author__ = 'Allan Galarza'
33

44
import logging

tibiapy/bazaar.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,8 @@ def _parse_charms_table(self, table):
11591159
_, *rows = table_content.find_all("tr")
11601160
for row in rows:
11611161
cols = row.find_all("td")
1162+
if len(cols) != 2:
1163+
continue
11621164
cost_c, name_c = [c.text for c in cols]
11631165
cost = parse_integer(cost_c.replace("x", ""))
11641166
self.charms.append(CharmEntry(name_c, cost))
@@ -1193,7 +1195,7 @@ def _parse_bestiary_table(self, table):
11931195
_, *rows = table_content.find_all("tr")
11941196
for row in rows:
11951197
cols = row.find_all("td")
1196-
if "more entries" in row.text:
1198+
if len(cols) != 3:
11971199
continue
11981200
step_c, kills_c, name_c = [c.text for c in cols]
11991201
kills = parse_integer(kills_c.replace("x", ""))

0 commit comments

Comments
 (0)