擅长:python、mysql、java
<p>你可以使用beauthoulsoup和regex的组合。这里regex用于获取limit标记之间的所有内容,然后使用BeautifulSoup提取锚定标记。在</p>
<pre><code>from bs4 import BeautifulSoup
import re
excerpts = re.findall(r'<i>Hello<\\i>(.*?)<i>Bye<\\i>', html, re.DOTALL)
for e in excerpts:
soup = BeautifulSoup(e)
for link in soup.findAll('a'):
print(link)
</code></pre>
<p>输出:</p>
^{pr2}$