chore: fix anthem url
This commit is contained in:
@@ -102,12 +102,9 @@ class CountrydownloaderSpider(scrapy.Spider):
|
||||
anthem_text = response.xpath("//div[@id='mw-content-text']/div/p").get()
|
||||
_anthem_file_url = response.xpath("//tr[contains(@class, 'haudio')]//a/@href").getall()
|
||||
|
||||
for file in _anthem_file_url:
|
||||
if file.endswith(".ogg") or file.endswith(".oga"):
|
||||
anthem_file_url = file
|
||||
break
|
||||
else:
|
||||
anthem_file_url = None
|
||||
anthem_file_url = next(
|
||||
(file for file in _anthem_file_url if file.endswith(".ogg") or file.endswith(".oga")), None
|
||||
)
|
||||
|
||||
country_scrapy_item = WikipediaCountryScraperItem()
|
||||
country_scrapy_item["country_url"] = country_item["country_url"]
|
||||
|
||||
Reference in New Issue
Block a user