Python删除某些标签下的文本

时间:2013-03-05 06:54:31

标签: python html

我想删除HTML中特定标记下的某些文字。 我想删除<TEXT>下的最后一个。

我认为当<TYPE>GRAPHIC时,<TEXT>有一些有线内容。 我只想删除<TEXT>

的内容

请帮帮我。谢谢

</DIV>

<DIV align="left" style="font-size: 10pt; margin-top: 6pt">In connection with the Annual Report on Form 20-F of SearchMedia Holdings Limited (the &#147;Company&#148;)for the fiscal year ended December&nbsp;31, 2010, as filed with the Securities and Exchange Commissionon the date hereof (the &#147;Report&#148;), I, Wilfred Chow, Chief Financial Officer of the Company, hereby certify, pursuant to 18 U.S.C. &#167;1350, as adopted pursuant to Section&nbsp;906 of the Sarbanes-Oxley Actof 2002, that, to my knowledge:
</DIV>

</BODY>
</HTML>
</TEXT>
</DOCUMENT>
<DOCUMENT>
<TYPE>GRAPHIC
<SEQUENCE>7
<FILENAME>g27632g2763201.gif
<DESCRIPTION>GRAPHIC
<TEXT>
begin 644 g27632g2763201.gif
M1TE&.#EA50)Q`^8``'EV=1D6%M73T8J(B)"-BD5#1*FFI=W;VOO[^H."@CDW
M-I>4D\'`P,C&Q\_+R$Q*2@@&!RTI*+6SLKV[NO;V]:6CH:VKJ>7DXVMH9X&4
MC?+R\9V;F5514>[M["0E)%E6565B8>KIZ%%-3%U:66UJ:N+AX.?EXZ_,PM#.
MS;"MK+BVM7!M;,;$Q)B6E:"=G(>%A;^]O,3"P=?6U<K)R&AE9)&JHV!=7-_>
MW>3BXF]_>G]\?.SKZDA%1>CFY<_-S+*PK\*_OC`M+.'@W^WLZS\\/"@E)9>P
MJ;JXM^CGYJ*@G]K8UX.`?\W+RLO(Q9J8EW.$?JNGI1\<').0C_7T\]+0SW-Q
M<+75RXR(AV-@7^_O[O/S\EM85Z&[LV-S;\;#P@X+#*;#NDQ(1T-`/U-04#0Q
M,+K;T2LH)R0@($E'1XRBFHF'A[#.Q!01Q54BHG)R(?'SM"0%)=6?W]_45-
M2OCX]_'P[T%'0VEG9U)/3Y&.CS(O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