0
您好我正在运行python正则表达式从新闻页面提取一些数据,但是当它显示时代码会在输出中生成括号和撇号。例如,这是我的代码:从新闻页面提取数据的正则表达式
description_title = findall('<item>[\s]*<title[^>]*>(.*?)<\/title>[\s]*<description>', html_source)[:1]
news_file.write('<h3 align="Center">' + str(description_title) + ": " + '</h3\n>')
但是这个代码创建[“技术”] :, [“财经”]的输出:但我想科技,金融,而不[“”]周围。
http://stackoverflow.com/questions/11178061/print-list-without-brackets-in-a-single-row –