Skip to content

Commit

Permalink
Fixed bug when iamge edition can't be found
Browse files Browse the repository at this point in the history
  • Loading branch information
T0RAT0RA committed Aug 31, 2018
1 parent 75a384c commit f943a87
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions deckbox_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,13 @@ def getCardsFromTable(self, page_type):
# card["tooltip"] = self._HTTP + self._DECKBOX_DOMAIN + self._TOOLTIP.replace("<cardname>", urllib.parse.quote(card["name"]))

edition_container = tr.find(".mtg_edition_container img")
card["edition"] = {
"code": re.search(".*/(.*)_.\.jpg$", edition_container.attr("src")).group(1),
"name": edition_container.attr("data-title")
}
card["edition"] = {}
try:
card["edition"]["code"] = re.search(".*/(.*)_.\.jpg$", edition_container.attr("src")).group(1),
except:
card["edition"]["code"] = None

card["edition"]["name"] = edition_container.attr("data-title")

# card["rarity"] = re.search(".*_(.)\.jpg$", edition_container.attr("src")).group(1)

Expand Down

0 comments on commit f943a87

Please sign in to comment.