在 chrome 中执行 applescipt 代码之前等待页面加载
wait for page to load before executing applescipt code in chrome
我在 applescript 中有一个自动填写网络表单的代码,我想在页面完全加载之前等待,然后继续 javascript 填写表单。
代码:
tell application "Google Chrome" to tell active tab of window 1
activate
open location "http://www."
delay 10
execute javascript "document.getElementById('ctl00_ContentPlaceHolder1_personDetails_titleDropDownList').value='Mr '"
提前致谢
我会将其添加到等待页面加载的 script
标记中。所以在页面底部会是这样的:
<script>
$(document).ready(function() {
document.getElementById('ctl00_ContentPlaceHolder1_personDetails_titleDropDownList').value='Mr ';
});
</script>
我在 applescript 中有一个自动填写网络表单的代码,我想在页面完全加载之前等待,然后继续 javascript 填写表单。
代码:
tell application "Google Chrome" to tell active tab of window 1
activate
open location "http://www."
delay 10
execute javascript "document.getElementById('ctl00_ContentPlaceHolder1_personDetails_titleDropDownList').value='Mr '"
提前致谢
我会将其添加到等待页面加载的 script
标记中。所以在页面底部会是这样的:
<script>
$(document).ready(function() {
document.getElementById('ctl00_ContentPlaceHolder1_personDetails_titleDropDownList').value='Mr ';
});
</script>