so I'm testing Beautiful soup with python (it's great for those how are wondering)
I have a problem when i want to get the href from a link that i got, and i don't understand why I can't get it.
here is my code:
for url in soup.find_all('article'):
if "Gonz Logo" in url.get_text():
if "Black" in url.get_text():
print(url)
this works but it gives me this:
<article><div class="inner-article"><a href="/shop/jackets/gw1diqgyr/n53istanq" style="height:150px;"><img alt="N7qmqyee 3g" height="150" src="//assets.supremenewyork.com/147789/vi/N7qMqyEe_3g.jpg" width="150"/></a><h1><a class="name-link" href="/shop/jackets/gw1diqgyr/n53istanq">Gonz Logo Coaches Jacket </a></h1><p><a class="name-link" href="/shop/jackets/gw1diqgyr/n53istanq">Black</a></p></div></article>
(yeah a big line...)
the probleme is i only want to get the href. when I try:
print(url.get('href'))
I get in output : None
I have no idea why.
thank you for your answers!