有谁能帮我在python的
标记中以简单的形式查找数据,我已经解释了这个问题Zale\u2019s largest shareholder, TIG, is highlighting Bank of America\u2019s conflict of interest in a sale to Signet Jewelers. That and other factors may lead shareholders to vote down the deal, Steven M. Davidoff writes in the Deal Professor. Read more…</a></p>\n</div>\n</article>"}
我想要像这样的输出
Zale largest shareholder, TIG, is highlighting Bank of America conflict of interest in a sale to Signet Jewelers. That and other factors may lead shareholders to vote down the deal, Steven M. Davidoff writes in the Deal Professor.
此代码
import urllib2
import re
response = urllib2.urlopen('http:')
print "Response:", response
regex = '<div class=\"entry-content\">(.*?)</div>'
pattern =re.compile(regex)
# Get all data
html = response.read()
splitsource = re.findall(pattern,html)
print "this is the",splitsource
但我已经空了
splisource = []
请帮忙
这将从html中的段落中获取文本:
看看beautifulsoup docs
相关问题 更多 >
编程相关推荐