Skip to content

Commit

Permalink
Fix bug with handling of missing organic link snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
joejoinerr committed May 11, 2022
1 parent b1f1e6a commit cb8e4dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion valueserp/serp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class OrganicLink:
title: str = dataclasses.field(repr=False)
url: str
url_displayed: str = dataclasses.field(repr=False)
description: str = dataclasses.field(repr=False)
description: Optional[str] = dataclasses.field(default=None, repr=False)
date: Optional[str] = dataclasses.field(default=None, repr=False)


Expand Down
2 changes: 1 addition & 1 deletion valueserp/serp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def links(self) -> Optional[List[OrganicLink]]:
title = link['title']
url = link['link']
url_displayed = link['displayed_link']
description = link['snippet']
description = link.get('snippet')
date = link.get('date')
links.append(OrganicLink(position=position,
block_position=block_position,
Expand Down

0 comments on commit cb8e4dc

Please sign in to comment.