好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Python抓取电影天堂电影信息的代码

Python2.7Mac OS

抓取的是电影天堂里面最新电影的页面。链接地址: http://HdhCmsTestdytt8.net/html/gndy/dyzz/index.html

获取页面的中电影详情页链接

import urllib2
import os
import re
import string


# 电影URL集合
movieUrls = []


# 获取电影列表
def queryMovieList():

 url = 'http://HdhCmsTestdytt8.net/html/gndy/dyzz/index.html' 
 conent = urllib2.urlopen(url)
 conent = conent.read()
 conent = conent.decode('gb2312','ignore').encode('utf-8','ignore') 
 pattern = re测试数据pile ('

.*?>

查看更多关于Python抓取电影天堂电影信息的代码的详细内容...

  阅读:39次