试图获取div类的XPath和div内部的文本。两个div是:
<div class="product-card__subtitle">Women's Shoe</div>
<div class="product-card__subtitle">Men's Shoe</div>
给出硒错误的我的Xpath是:
driver.find_element_by_xpath("//div[contains(@class,'product-card__subtitle') and text("
")='Women's Shoe']")
driver.find_element_by_xpath("//div[contains(@class,'product-card__subtitle') and text()='Men's "
"Shoe']")