このコードをウェブサイトで実行します: juventus.com.I can parse the title
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
誰かが理由を知っていますか?