Skip to content

Commit

Permalink
fix: make BeautifulSoup parsing more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Sep 26, 2023
1 parent 00b3665 commit dc2d47b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aiovodafone/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def _find_login_url(self) -> str:
reply_text = await reply.text()
soup = BeautifulSoup(reply_text, "html.parser")
meta_refresh = soup.find("meta", {"http-equiv": "Refresh"})
if isinstance(meta_refresh, Tag) and "content" in meta_refresh:
if isinstance(meta_refresh, Tag) and "content" in meta_refresh.attrs.keys():
meta_content = meta_refresh.get("content")
parsed_qs = urllib.parse.parse_qs(str(meta_content), separator="; ")
reply_url: str = parsed_qs["URL"][0]
Expand Down

0 comments on commit dc2d47b

Please # to comment.