10年IMDB250高分排行电影下载链接提取(python)

此代码用于提取http://www.zreading.net/671.html网页中10年IMDB250高分排行电影所有下载链接,用于批量导入下载。

# -*- coding: utf-8 -*-
import re
import urllib
url='http://www.zreading.net/671.html'
s=urllib.urlopen(url).read()
ss=s.replace('\n','')
urls=re.findall('<a id="(\S*?) href="(\S*?)" target="_blank">',ss,re.I)
for i in urls:
	print i[1]

#urls=re.findall('<a href="(\S*?)" target="_blank">',ss,re.I)

Leave a Reply

Your email address will not be published. Required fields are marked *