我们可以使用python代码抓取并下载从新闻网站获取的音频吗?

时间:2019-06-10 08:45:53

标签: python audio web-scraping

driver.get("https://www.facebook.com/pg/state.counsellor/videos/ref=page_internal")

folder = r"C:\Users\user\Desktop\Web 
Scraping\Facebook_Page\All_Videos" + "\\"

#element = driver.find_element_by_class_name('uiGd _51mz')
element = driver.find_element_by_class_name('ay5')
element1 = element.find_elements_by_tag_name('a')
list = []
for a in element1:
    list.append(a.get_attribute('href'))


final_list = [] 
for num in list: 
    if num not in final_list: 
        final_list.append(num) 

del final_list[-1]

request.urlretrieve(final_list[1],'file.mp4')    
url = 'https://www.facebook.com/state.president/videos/301269537439407/'
request.urlretrieve('https://www.facebook.com/state.counsellor/videos/301269537439407/','file4.mp4')

使用python从新闻网站(https://www.bbc.com/news/video_and_audio/headlines)或facebook网站下载音频和视频

0 个答案:

没有答案