我的頁面上有多個包含類似href的按鈕。它們僅與id_invoices不同。我想用XPath和HREF它看起來像點擊頁面上的一個按鈕:按xpath中的最大號碼選擇按鈕
href="/pl/payment/getinvoice/?id_invoices=461"
我可以使用全部選擇按鈕:
invoices = driver.find_elements_by_xpath("//a[contains(@href, '/payment/getinvoice/')]")
,但我需要只選擇最高id_invoices按鈕。可以做到嗎? :)
將該值存儲在臨時變量中並與發票相匹配 – iamsankalp89