Skip to content

Commit

Permalink
Fixed special_attributes_str loop only it items are available
Browse files Browse the repository at this point in the history
At issue #323 the ad_2827968602 had NO special_attributes. 
This broke down the for loop.

Fixed by adding a check for tiems.
  • Loading branch information
Saghalt authored Sep 2, 2024
1 parent 3154005 commit 2d336d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kleinanzeigen_bot/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async def _extract_special_attributes_from_ad_page(self) -> dict[str, Any]:
"""
belen_conf = await self.web_execute("window.BelenConf")
special_attributes_str = belen_conf["universalAnalyticsOpts"]["dimensions"]["dimension108"]
special_attributes = dict(item.split(":") for item in special_attributes_str.split("|"))
special_attributes = dict(item.split(":") for item in special_attributes_str.split("|") if ":" in item)
special_attributes = {k: v for k, v in special_attributes.items() if not k.endswith('.versand_s') and k != "versand_s"}
return special_attributes

Expand Down

0 comments on commit 2d336d2

Please sign in to comment.