马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import requests
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
driver = webdriver.Chrome()
headers = {'Host':'m.ting55.com',
'Origin':'https://m.ting55.com',
'Referer':'https://m.ting55.com/book/14888',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36 LBBROWSER'}
for i in range(180,181):
url = f'https://m.ting55.com/book/14888-{i}'
driver.get(url)
time.sleep(5)
audio_url = driver.find_element(By.XPATH,'//*[@id="player"]').get_attribute("src")
#print(audio_url)
response = requests.get(audio_url,headers=headers).content
with open(f'H:\\有声小说\\{i}.mp3','wb') as f:
f.write(response)
time.sleep(5)
琢磨了半宿,总算搞成了 |