失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 电影天堂电影链接爬取

电影天堂电影链接爬取

时间:2022-05-13 14:45:43

相关推荐

电影天堂电影链接爬取

1 import requests,re 2 3 4 def getdetail(url): 5 6response = requests.get(url) 7html = response.content.decode('gbk') 8# 电影详情页标题 9movie_title_name = re.search('<h1><font color=#07519a>(.*)</f',html)10movie_title = movie_title_name.group(1)11# 电影 磁力 magnet12movie_magnet_url = re.search('/><a href="(.*)"><str',html)13# print(movie_magnet.group(1))14movie_magnet = movie_magnet_url.group(1)15# torrent种子16movie_torrent_url = re.search('ddf"><a href="(.*)">ft',html)17movie_torrent = movie_torrent_url.group(1)18# print(movie_torrent.group(1))19# 这个列表用来title20movie_title_list = []21movie_title_list.append(movie_title)22 23# 这个列表两个下载的链接24movie_down_url = []25movie_down_url.append(movie_magnet)26movie_down_url.append(movie_torrent)27movie_down_url_all = []28movie_down_url_all.append(movie_down_url)29 30 31movie_dict = dict(zip(movie_title_list,movie_down_url_all))32print(movie_dict)33 34 35 36 def getpage():37 38for i in range(1,178):39 lurl = '/html/gndy/dyzz/list_23_%s.html' % i40 41 response = requests.get(lurl)42 43 html = response.text44 45 movie_url_list = re.findall('<a href="(.*)" class="ulink"',html)46 47 for movie_item in movie_url_list:48 movie_url = ''+movie_item49 getdetail(movie_url)50 51 52 if __name__ == '__main__':53getpage()

如果觉得《电影天堂电影链接爬取》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。