美丽汤在子元素中找到href [英] Beautiful Soup find href inside a child element
本文介绍了美丽汤在子元素中找到href的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经尝试了不同的解决方案,但是无法在<a>
元素内获取href
.
我可以使用soup.select("div.quicklinks")
到达div类,但是然后我不知道如何使用title=Details
接受href
.
I already tried different solutions, but I can't get the href
inside the <a>
element.
I can reach the div class with soup.select("div.quicklinks")
but then I do not know how to take the href
with title=Details
.
感谢帮助.
推荐答案
尝试使用:-
divElement.find("a", { "title" : "Details" })
这篇关于美丽汤在子元素中找到href的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文