我在网站上运行这段代码:juventus.com。我可以解析标题
from urllib import urlopen
import re
webpage = urlopen('http://juventus.com').read()
patFinderTitle = re.compile('<title>(.*)</title>')
findPatTitle = re.findall(patFinderTitle, webpage)
print findPatTitle
输出是:
['Welcome - Juventus.com']
但是如果在另一个网站上尝试相同的代码返回什么都不是
from urllib import urlopen
import re
webpage = urlopen('http://bp1.shoguto.com/detail.php?userg=hhchpxqhacciliq').read()
patFinderTitle = re.compile('<title>(.*)</title>')
findPatTitle = re.findall(patFinderTitle, webpage)
print findPatTitle
有谁知道为什么?