1
content='<p>Hello, the web site is <a href="https://www.google.com">Google</a></p>. <p>The search engine is <a href="https://www.baidu.com">Baidu</a></p>.'
soup = BeautifulSoup(content, 'html.parser')
现在我想在HREF的URL地址来替换整个<a> </a>
。所以我想得到预期的结果:更换<a></a>与HREF在BeautifulSoup
Hello, the web site is https://www.google.com. The search engine is https://www.baidu.com.
任何人都可以提供解决方案吗?
和问题是什么?首先使用BS找到''并获得'href'。 – furas