我有一个HTML文档,我使用
从中获取一些数据data=content.find_all("a", {"class": "result-title"})
然后数据如下:
[ < a class = "result-title hover_feedback zred bold ln24 fontsize0 "
data - result - type = "ResCard_Name"
href = "https://www.zomato.com/bangalore/flechazo-marathahalli"
title = "flechazo Restaurant, Marathahalli" > Flechazo <
/a>]
现在我想要data
的摘录
01. https://www.zomato.com/bangalore/flechazo-marathahalli
02. Flechazo
任何帮助都将不胜感激。
答案 0 :(得分:1)
这将有助于
links = content.find_all("a", {"class": "result-title"})
for link in links:
print(link.get('href', None))
print(link.text)
<强>输出强>
https://www.zomato.com/bangalore/flechazo-marathahalli
Flechazo