【发布时间】:2018-04-20 21:35:58
【问题描述】:
我有一个简单的脚本,它获取一个 html 页面并尝试输出关键字元标记的内容。不知何故,即使 html 包含标签,它也没有获取关键字元标签的内容。任何帮助表示赞赏。
url = “https://www.mediapost.com/publications/article/316086/google-facebook-others-pitch-in-app-ads-brand-s.html”
req = urllib2.Request(url=url)
f = urllib2.urlopen(req)
mycontent = f.read()
soup = BeautifulSoup(mycontent, 'html.parser')
keywords = soup.find("meta", property="keywords")
print keywords
【问题讨论】:
标签: python beautifulsoup meta