<div data-pet-card="pet-card" class="pet-card">
<a data-pet-card="pet-card-link" href="https://Link-I-Want.com"
class="pet-card__link">
我习惯于使用BS4来爬取html,但并不是非常熟悉html本身,并且没有遇到过带有类和 data-pet-card="pet-card-link"
的href。 我尝试过:
for a in soup.find_all('a', href=True):
print("Found the URL:", a['href'])
但是它没有输出任何内容,也没有给出错误。
任何帮助都是有用的,谢谢。
a
标签。 - Daniel Roseman