我从 Chrome 中检查了以下代码。我正在尝试单击此对象。理想情况下利用 xpath 或 css 选择器。
我复制了如下所述的 Xpath
/html/body/form/table[4]/tbody/tr/td[1]/table/tbody/tr[3]/td
这是完整路径
<td style="text-decoration: none; color: rgb(0, 0, 0); font-family: Arial; font-size: 11px; padding-bottom: 2px; padding-top: 1px; border-bottom: 1px solid rgb(194, 194, 194); background: rgb(255, 255, 255); cursor: auto;" onmouseover="this.style.background='#BED9F5'; this.style.cursor='hand'; showTitle(this,'Review Quotes / Quote To Order',150,true); window.status='Review Quotes / Quote To Order'; return true;" onmouseout="this.style.background='#FFFFFF'; this.style.cursor='auto'; hideTitle(); window.status=' '; return true;" onclick="if (warnUnfinishedPage()) return false; changePage('pc.quote.html.QuoteSummarySection','refresh'); return false;" align="left" width="110" valign="middle" title="Review Quotes / Quote To Order">
Quotes
</td>
Katalon Recorder 将 Python 导出为以下几个选项,但似乎没有一个对我有用。他们都回来了no such element。我认为这可能与括号有关?
driver.find_element_by_xpath("//td[@onclick=\"if (warnUnfinishedPage()) return false; changePage('pc.quote.html.QuoteSummarySection','refresh'); return false;\"]").click()
driver.find_element_by_xpath("//tr[3]/td").click()
driver.find_element_by_css_selector("td[title=\"Review Quotes / Quote To Order\"]").click()
任何关于我可以尝试的其他事情的建议将不胜感激!