这是HTML:
<a class="editorButton" href="javascript:validateAndSubmit(document.form,'/Dispatcher?page=ExpressReqEditor&element=Submit&sig=R2pneG9IbTVSaFh0MEo4ZWFEQkxlUWZpQkhjPTtORFpsWVRNeE56UXRaamt3TkMwMFpqaGpMV0kxWlRZdE5ESXpOREJpWVRSbU5EQmk7cGFnZTtlbGVtZW50');"> submit </a>
我已经尝试了我能想到的所有事情,但没有运气。我能找到它的唯一方法是通过它的 xpath:
html/body/form/table/tbody/tr/td/table/tbody/tr[52]/td[2]/a[3] >
这是我尝试过的:
driver.findElement(By.xpath("//a[contains(text(), ' Submit ')]")).click();
driver.findElement(By.xpath("//a[contains(.,' Submit ')]")).click();
driver.findElement(By.xpath("//a[contains(normalize-space(.),' Submit ')]")).click();
driver.findElement(By.xpath("//a[contains(normalize-space(.),'Submit')]")).click();
driver.findElement(By.xpath("//a[contains(text(), '  submit  ')]")).click();
driver.findElement(By.xpath("//a[contains(text(), ' submit ')]")).click();
任何帮助都会很棒