Need to use a tag, not div

This commit is contained in:
2023-03-23 00:26:54 -04:00
parent d2d81f7119
commit ede4767a39
2 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@ expected_desc = (
)
expected_img_url = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcT-PqtK-bauo8wm8dBE__SVGArlvfBYY8rqxr2kA5UwjKzEx8c"
expected_google_url = "https://podcasts.google.com/feed/aHR0cHM6Ly9mZWVkcy5ucHIub3JnLzUxMDMxOC9wb2RjYXN0LnhtbA"
def test_get_not_allowed_from_mopidy():
@ -24,4 +25,4 @@ def test_get_not_allowed_from_mopidy():
assert result_dict["description"] == expected_desc
assert result_dict["image_url"] == expected_img_url
assert result_dict["producer"] == "NPR"
assert result_dict["url"] == None
assert result_dict["google_url"] == expected_google_url

View File

@ -33,7 +33,7 @@ def _get_title_from_soup(soup) -> Optional[int]:
def _get_url_from_soup(soup) -> Optional[int]:
url = None
try:
url_tag = soup.find("div", class_="yXo2Qc")
url_tag = soup.find("a", class_="yXo2Qc")
if url_tag:
url = _build_google_url(url_tag.get("href"))
except ValueError: