使用Beautifulsoup,我想找到<a>
不<p>
封闭,并用<p>
它括包装他们,但我不知道该怎么办呢如何找到不是由特定标签环绕标签与标签
<p><a href="example1.com">example1.com</a></p>
<p><a href="example2.com">example2.com</a></p>
<a href="example3.com">example3.com</a>
<p><a href="example3.com">example3.com</a></p>
我想改变HTML如上
<p><a href="example1.com">example1.com</a></p>
<p><a href="example2.com">example2.com</a></p>
<p><a href="example3.com">example3.com</a></p> <-here
<p><a href="example3.com">example3.com</a></p>
你尝试过什么?你的代码? –