- 帖子
- 20
- 精华
- 0
- 积分
- 166
- 阅读权限
- 20
- 注册时间
- 2018-10-15
- 最后登录
- 2019-4-13
|
- #!usr/bin/python
- # coding=UTF-8
- import urllib2
- from bs4 import BeautifulSoup
- print '豆瓣正在热映:'
- url="http://movie.douban.com"
- html=urllib2.urlopen(url).read()
- soup=BeautifulSoup(html)
- div_hot=soup.find('div',{"id":"sceeening"})
- for i in div_hot.find_all('li',class_='title'):
- movie_title=i.a.get_text()
- #movie_title = movie_title.strip() #去除movie_title两边的空格
- print movie_title
- print '\n豆瓣近期热门:'
- div_new=soup.find('div',{"id":"new-movies"})
- for i in div_new.find_all('li',class_='title'):
- movie_new=i.a.get_text
- print movie_new
复制代码 File "D:\Python\python27\lib\site-packages\beautifulsoup4-4.6.3-py2.7.egg\bs4\dammit.py", line 14, in <module>
from html.entities import codepoint2name
ImportError: No module named html.entities
|
|