Mar-05-2020, 01:30 PM
I want to create a code wich gets the href=... of a specific name in the html code. A part of the html code looks like this:
class="name-link" href="/shop/pants/xz7ypjoam/i4lsmo5e7">Cargo Pant</a> == $0
there are more parts in the html code that look like this. Cause there are multiple products on the website (Supreme). I have got the name of the product -> Cargo Pant . Does someone know how I can get the href value from this specific line instead of a other line in the html code wich also includes a href= ? This was my code wich printed out all the href links on the page. But i just want that specific link from the product with Tupac Hologram Tee as the name.
https://www.supremenewyork.com/shop/all/pants
class="name-link" href="/shop/pants/xz7ypjoam/i4lsmo5e7">Cargo Pant</a> == $0
there are more parts in the html code that look like this. Cause there are multiple products on the website (Supreme). I have got the name of the product -> Cargo Pant . Does someone know how I can get the href value from this specific line instead of a other line in the html code wich also includes a href= ? This was my code wich printed out all the href links on the page. But i just want that specific link from the product with Tupac Hologram Tee as the name.
session = HTMLSession() r = session.get(url) word = r.html.links print(word)This is my code uptill now. This prints out all the href values on the page. But i just want a specific value. The url to the page is:
https://www.supremenewyork.com/shop/all/pants