@@ -461,6 +461,8 @@ class DisplayItem(abc.Serializable):
461461 The URL to the item's image.
462462 name: :class:`str`
463463 The item's name.
464+ description: :class:`str`
465+ The item's description, if any.
464466 count: :class:`int`
465467 The item's count.
466468 item_id: :class:`int`
@@ -469,13 +471,15 @@ class DisplayItem(abc.Serializable):
469471 __slots__ = (
470472 "image_url" ,
471473 "name" ,
474+ "description" ,
472475 "count" ,
473476 "item_id" ,
474477 )
475478
476479 def __init__ (self , ** kwargs ):
477480 self .image_url : str = kwargs .get ("image_url" )
478481 self .name : str = kwargs .get ("name" )
482+ self .description : str = kwargs .get ("description" )
479483 self .count : int = kwargs .get ("count" , 1 )
480484 self .item_id : int = kwargs .get ("item_id" , 0 )
481485
@@ -484,21 +488,24 @@ def __repr__(self):
484488
485489 @classmethod
486490 def _parse_image_box (cls , item_box ):
487- description = item_box ["title" ]
491+ title_text = item_box ["title" ]
488492 img_tag = item_box .find ("img" )
489493 if not img_tag :
490494 return None
491495 amount_text = item_box .find ("div" , attrs = {"class" : "ObjectAmount" })
492496 amount = parse_tibia_money (amount_text .text ) if amount_text else 1
493497 item_id = 0
494498 name = None
499+ description = None
500+ if "\n " in title_text :
501+ description = title_text .split ("\n " , 1 )[1 ]
495502 m = id_regex .search (img_tag ["src" ])
496503 if m :
497504 item_id = int (m .group (1 ))
498- m = description_regex .search (description )
505+ m = description_regex .search (title_text )
499506 if m :
500507 name = m .group (1 )
501- return DisplayItem (image_url = img_tag ["src" ], name = name , count = amount , item_id = item_id )
508+ return DisplayItem (image_url = img_tag ["src" ], name = name , count = amount , item_id = item_id , description = description )
502509
503510
504511class DisplayMount (DisplayImage ):
@@ -944,7 +951,7 @@ def from_content(cls, content, auction_id=0):
944951 Returns
945952 -------
946953 :class:`AuctionDetails`
947- The auction detaiils if found, :obj:`None` otherwise.
954+ The auction details if found, :obj:`None` otherwise.
948955
949956 Raises
950957 ------
@@ -996,6 +1003,16 @@ def from_content(cls, content, auction_id=0):
9961003
9971004 @classmethod
9981005 def _parse_tables (cls , parsed_content ):
1006+ """Parses c
1007+
1008+ Parameters
1009+ ----------
1010+ parsed_content
1011+
1012+ Returns
1013+ -------
1014+
1015+ """
9991016 details_tables = parsed_content .find_all ("div" , {"class" : "CharacterDetailsBlock" })
10001017 return {table ["id" ]: table for table in details_tables }
10011018
0 commit comments