擅长:python、mysql、java
<p>另一个解决方案</p>
<pre><code>from simplified_scrapy import SimplifiedDoc,req,utils
html = '''<Segment StartTime="639.752" EndTime="642.270" Participant="fe016">
But I bet it's a good <Pause/> superset of it.
</Segment>'''
doc = SimplifiedDoc(html)
print(doc.Segment)
print(doc.Segment.text)
</code></pre>
<p>结果:</p>
<pre><code>{'StartTime': '639.752', 'EndTime': '642.270', 'Participant': 'fe016', 'tag': 'Segment', 'html': "\n But I bet it's a good <Pause /> superset of it.\n"}
But I bet it's a good superset of it.
</code></pre>
<p>这里有更多的例子<a href="https://github.com/yiyedata/simplified-scrapy-demo/blob/master/doc_examples" rel="nofollow noreferrer">https://github.com/yiyedata/simplified-scrapy-demo/blob/master/doc_examples</a></p>