之前用beautifulsoup解析wap页面很溜的,今天突然不行了,求教这是咋回事。
#!/usr/bin/python
#-*-coding:utf-8-*-
import urllib2
from bs4 import BeautifulSoup
url1 = 'http://www.baidu.com/'
url2 = 'http://wap.baidu.com'
html = urllib2.urlopen(url).read()
c1 = BeautifulSoup(html,from_encoding='utf8')
c2 = c1.title
print c2
#运行url1的时候能解析出Title
#运行url2的时候结果是none
请问这个该咋处理,另外我昨天安装了html5lib,会不会是这个导致的?