我正在尝试提取第一段。但我发现运气不错。谁能帮我?这是文字。 http://dpaste.com/638776/。我的文字是动态的。感谢
更新:我正在使用eTree模块阅读XML文件。在XML中,有一个名为<text></text>
的标记。 <text></text>
is here之间的数据。我只想打印来自text tags
的数据。可能吗?感谢
'''Zamindar''' ({{te|జమీందార్}}) is a 1965 [[Telugu language|Telugu]] "Thriller" film
directed by [[V. Madhusudhan Rao]] and produced by [[Tammareddy Krishna Murthy]]
of Ravindra Art Pictures.This is variety role for [[Akkineni Nageswara Rao]]
who is more popular with soft Romantic roles.He plays the role of a tough CID Officer very well.The Movie has some Good songs.This movie has a considerable resemblance with the 1963 [[Cary Grant]] English Movie ''[[Charade (1963 film)|Charade]]''.
答案 0 :(得分:1)
答案 1 :(得分:0)
根据新信息修改......
如果您能够在标签之间生成文本,您只需找到适合所有情况的第一段的模式,因此基于此示例:
#data - stuff between text tags
firstparagraph = re.search("}}(.*?)\r*\n\r*\n",data,re.DOTALL)
print firstparagraph.group(1)