I have a list of links that I am iterating through such as below
https://www.loc.gov/item/2015669100/
https://www.loc.gov/item/2015669101/
https://www.loc.gov/item/2015669102/
https://www.loc.gov/item/2015669103/
https://www.loc.gov/item/2015669104/
https://www.loc.gov/item/2015669105/
https://www.loc.gov/item/2015669106/
https://www.loc.gov/item/2015669107/
https://www.loc.gov/item/2015669108/
https://www.loc.gov/item/2015669109/
If you look at these links, you can see that it has a video and a downloadable XML file. My task is to download the audio from the video and download the XML file together from one page.
My problem is that, how do I just get the audio from such audio files?
below is my code currently.
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
base_html = "https://www.loc.gov/collections/civil-rights-history-project/?sp={}"
for i in range(1,8):
html = base_html.format(i)
req = Request(html, headers={'User-Agent': 'Mozilla/5.0'})
soup = BeautifulSoup(urlopen(req).read(), 'html.parser')
pages = soup.findAll('div', attrs={'class' : 'item-description'})
for div in pages:
crawl_p = div.find('a')['href']
#some logic here