使用 iMacros 单击 JavaScript link 使用 "a" 中的标题和 document.querySelector()?
Using iMacros to click on JavaScript link using the title in an "a" with document.querySelector()?
我需要用我的 iMacros 脚本点击 "Save Changes" link,但不知何故我无法点击。这是 link 及其周围的 HTML 代码:
<span id="ctl09_ctl00_avbSavePropertySettings">
<table Title="" class="printhide" cellpadding="0" cellspacing="0" border="0"
onmouseover="self.status='Save the changes to the property.';return true;"
onmouseout="self.status='';return true;">
<tr><td class="AvidButton-left" width="12" height="17" rowspan="3"></td>
<td class="AvidButton-top" height="3"></td>
<td class="AvidButton-right" width="7" height="17" rowspan="3"></td></tr>
<tr>
<td nowrap="nowrap" class="AvidButton-text" height="11">
<a onclick="return propertyClass.save(this);" title="Save Changes"
href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions
("ctl09$ctl00$avbSavePropertySettings$ctl07",
"", true, "", "", false, true))">Save Changes</a></td>
</tr>
<tr><td class="AvidButton-bottom" height="3"></td></tr>
</table>
</span>
当我尝试使用 Chrome 开发人员工具时,它起作用了:
document.querySelector("a[title='Save Changes']").click();
但是当我尝试在我的 iMacros 代码中使用它时它不起作用:
URL GOTO=javascript:document.querySelector("a[title='Save Changes']").click();
以下是我尝试过的一些其他命令:
TAG SELECTOR="#ctl09_ctl00_avbSavePropertySettings>TABLE>TBODY>TR:nth-of-type(2)>TD>A"
TAG XPATH="./a[contains(.,'Save Changes')]
TAG SELECTOR="#ctl09_ctl00_avbSavePropertySettings>TABLE>TBODY>TR:nth-of-type(2)>TD>A"
TAG POS=1 TYPE=A ATTR=TXT:Save<SP>Changes
TAG XPATH="//*[@id="ctl09_ctl00_avbSavePropertySettings"]/table/tbody/tr[2]/td/a"
TAG XPATH="//*[@id="ctl09_ctl00_avbSavePropertySettings"]/table/tbody/tr[2]/td/a"
EVENT TYPE=CLICK XPATH="//*[@id="ctl09_ctl00_avbSavePropertySettings"]/table/tbody/tr[2]/td/a"
TAG POS=1 TYPE=A ATTR=TITLE:"Save Changes"
欢迎任何建议 - 我已经在这上面花了太长时间了!
非常感谢!
也许下面这行代码会对您有所帮助:
EVENT TYPE=CLICK SELECTOR="a[title='Save Changes']"
你也可以试试这个:
URL GOTO=javascript:document.querySelector("a[title='Save<SP>Changes']").click();
我需要用我的 iMacros 脚本点击 "Save Changes" link,但不知何故我无法点击。这是 link 及其周围的 HTML 代码:
<span id="ctl09_ctl00_avbSavePropertySettings">
<table Title="" class="printhide" cellpadding="0" cellspacing="0" border="0"
onmouseover="self.status='Save the changes to the property.';return true;"
onmouseout="self.status='';return true;">
<tr><td class="AvidButton-left" width="12" height="17" rowspan="3"></td>
<td class="AvidButton-top" height="3"></td>
<td class="AvidButton-right" width="7" height="17" rowspan="3"></td></tr>
<tr>
<td nowrap="nowrap" class="AvidButton-text" height="11">
<a onclick="return propertyClass.save(this);" title="Save Changes"
href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions
("ctl09$ctl00$avbSavePropertySettings$ctl07",
"", true, "", "", false, true))">Save Changes</a></td>
</tr>
<tr><td class="AvidButton-bottom" height="3"></td></tr>
</table>
</span>
当我尝试使用 Chrome 开发人员工具时,它起作用了:
document.querySelector("a[title='Save Changes']").click();
但是当我尝试在我的 iMacros 代码中使用它时它不起作用:
URL GOTO=javascript:document.querySelector("a[title='Save Changes']").click();
以下是我尝试过的一些其他命令:
TAG SELECTOR="#ctl09_ctl00_avbSavePropertySettings>TABLE>TBODY>TR:nth-of-type(2)>TD>A"
TAG XPATH="./a[contains(.,'Save Changes')]
TAG SELECTOR="#ctl09_ctl00_avbSavePropertySettings>TABLE>TBODY>TR:nth-of-type(2)>TD>A"
TAG POS=1 TYPE=A ATTR=TXT:Save<SP>Changes
TAG XPATH="//*[@id="ctl09_ctl00_avbSavePropertySettings"]/table/tbody/tr[2]/td/a"
TAG XPATH="//*[@id="ctl09_ctl00_avbSavePropertySettings"]/table/tbody/tr[2]/td/a"
EVENT TYPE=CLICK XPATH="//*[@id="ctl09_ctl00_avbSavePropertySettings"]/table/tbody/tr[2]/td/a"
TAG POS=1 TYPE=A ATTR=TITLE:"Save Changes"
欢迎任何建议 - 我已经在这上面花了太长时间了!
非常感谢!
也许下面这行代码会对您有所帮助:
EVENT TYPE=CLICK SELECTOR="a[title='Save Changes']"
你也可以试试这个:
URL GOTO=javascript:document.querySelector("a[title='Save<SP>Changes']").click();