2.程序代碼
程序代碼如下:
import re from selenium import webdriver # url="https://www.ixigua.com/6982149651281478152?logTag=cc6bf98fd0f8fe35fe0e" url=input("輸入視頻鏈接:") group_id=re.findall('https://www.ixigua.com/(.*)\&;logTag=.*',url) url='https://www.ixigua.com/embed?group_id='+group_id[0] # 進(jìn)入瀏覽器設(shè)置 options = webdriver.ChromeOptions() # 設(shè)置中文 options.add_argument('lang=zh_CN.UTF-8') # 更換頭部 options.add_argument('user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"') driver=webdriver.Chrome(options=options) driver.get(url=url) driver.implicitly_wait(5) infos=driver.find_elements_by_xpath("http://xg-definition/ul/li") for info in infos[:-1]: print(info.get_attribute("definition")) print('http:'+info.get_attribute("url"))
Python爬蟲(chóng)下載西瓜視頻
到此這篇關(guān)于Python 給我一個(gè)鏈接 西瓜視頻隨便下載 爬蟲(chóng)的文章就介紹到這了,更多相關(guān)Python爬蟲(chóng)視頻內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
標(biāo)簽:漯河 南平 林芝 寧夏 海南 盤(pán)錦 普洱 大同
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Python 給我一個(gè)鏈接西瓜視頻隨便下載爬蟲(chóng)》,本文關(guān)鍵詞 Python,給我,一個(gè),鏈接,西瓜,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。