Need to use a tag, not div
This commit is contained in:
@ -14,6 +14,7 @@ expected_desc = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
expected_img_url = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcT-PqtK-bauo8wm8dBE__SVGArlvfBYY8rqxr2kA5UwjKzEx8c"
|
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():
|
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["description"] == expected_desc
|
||||||
assert result_dict["image_url"] == expected_img_url
|
assert result_dict["image_url"] == expected_img_url
|
||||||
assert result_dict["producer"] == "NPR"
|
assert result_dict["producer"] == "NPR"
|
||||||
assert result_dict["url"] == None
|
assert result_dict["google_url"] == expected_google_url
|
||||||
|
|||||||
@ -33,7 +33,7 @@ def _get_title_from_soup(soup) -> Optional[int]:
|
|||||||
def _get_url_from_soup(soup) -> Optional[int]:
|
def _get_url_from_soup(soup) -> Optional[int]:
|
||||||
url = None
|
url = None
|
||||||
try:
|
try:
|
||||||
url_tag = soup.find("div", class_="yXo2Qc")
|
url_tag = soup.find("a", class_="yXo2Qc")
|
||||||
if url_tag:
|
if url_tag:
|
||||||
url = _build_google_url(url_tag.get("href"))
|
url = _build_google_url(url_tag.get("href"))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|||||||
Reference in New Issue
Block a user