Hello so I am going through a webpage to find elements with a certain text and then either click or not click on them based on if the items are sold out or not. However when I try to print out the element text after I find the ones I want, it does not print out the text. It either does not print or I just get newlines:
browser = webdriver.Chrome()
browser.get("https://hoshiikins.com/") #navigates to hoshiikins.com
items = browser.find_elements_by_class_name("product-item__link") #finds all of the page products and puts them in a list
wanted_item = "husky" #keyword in product herf that lables the product we want
first_product_sold_check = items[0].find_element_by_class_name("product-item__meta__inner")
first_product_sold_check = first_product_sold_check.find_element_by_class_name("product-item__sold-out")
first_product_sold_check = first_product_sold_check.getText()
print(first_product_sold_check + "This is gonnee")
second_product_sold_check = items[0].find_element_by_xpath("//*[contains(text(), 'Sold out')]")
print(str(second_product_sold_check.text) + "Its sold out :{")
And here is the part of the page that I am looking at
<div class="product-item grid__item medium-up--one-half">
<a class="product-item__link product-item__image--margins" href="/products/byo-husky-tail-preorder">
<img class="product-item__image" src="//cdn.shopify.com/s/files/1/1409/8528/products/image_ba9bfdf5-7dde-424e-8ee7-765b372d70bf_grande.jpg?v=1506191375" alt="BYO Husky Tail *PREORDER*">
<span class="product-item__meta">
<span class="product-item__meta__inner">
<p class="product-item__vendor">Hoshiikins</p>
<p class="product-item__title">BYO Husky Tail *PREORDER*</p>
<p class="product-item__price-wrapper">
<span class="visually-hidden">Regular price</span> $36
</p>
<p class="product-item__sold-out">Sold out</p>
</span>
</span>
</a>
</div>
