发布时间:2019-09-11 07:43:11编辑:auto阅读(2405)
本文是小强全栈测试开发班学员投稿,比心!
前言
为了看美剧《天蝎》,终于在电影天堂网站找到了,嘎嘎,于是就想下载下来好好欣赏。
代码
import requests,re,os,time
#电影的URL地址
url = "http://www.dygod.net/html/tv/oumeitv/109673.html"
s = requests.get(url)
# print(s.encoding) #打印下汉字的编码类型
res = re.findall('href="(.*?)">ftp',s.text)
for resi in res:
#汉字转换成utf-8编码
# print(i.encode("iso-8859-1").decode('gbk').encode('utf8').decode('utf8'))
a=resi.encode("iso-8859-1").decode('gbk').encode('utf8').decode('utf8')
print(a) #打印一下看下效果
os.chdir("D:\Program Files (x86)\Thunder Network\Thunder\Program\")
os.system("Thunder.exe -StartType:DesktopIcon "%s"" % a)
time.sleep(1)
运行代码后效果图:

我用的是迅雷极速版,安装在D盘。
注意:在进行下载之前需先启动迅雷
上一篇: Windows 2003 + ISA 2
下一篇: Python基础入门视频课程——笔记
 51197
 50616
 41238
 38053
 32516
 29423
 28283
 23142
 23098
 21436
 1493°
 2206°
 1830°
 1759°
 2067°
 1817°
 2501°
 4200°
 4062°
 2899°