4

I'm trying to build a script to post auto blog on Google Sites but the problem is that the button won't click. This is my screenshot: http://i.stack.imgur.com/W5mxq.png

Code Button

<div aria-label="New page" tabindex="0" style="-moz-user-select: none;" role="button" id="create-new-btn" class="goog-inline-block jfk-button jfk-button-standard jfk-button-collapse-left" aria-disabled="false"><span id="sites-collaborator-bar-create-new-page-icon" class="sites-camelot-icon"></span></div>

This is my code in Imacros

Code IMACROS

VERSION BUILD=7601105 RECORDER=FX
TAB T=1
URL GOTO=https://sites.google.com/site/testing/
TAG POS=1 TYPE=DIV ATTR=ID:create-new-btn

This is other code but in Javascript Imacros

Code JAVA

var macro;
macro = "CODE:";
macro += "TAB T=1" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !ERRORCONTINUE YES" + "\n";
macro += "SET !EXTRACT_TEST_POPUP NO" + "\n";
macro += "SET !TIMEOUT 500" + "\n";
macro += "URL GOTO=https://sites.google.com/site/testing/" + "\n";
macro += "TAG POS=1 TYPE=DIV ATTR=ID:create-new-btn" + "\n";
iimPlay(macro)
4

4 回答 4

2

you can simply load create new page form instead of clicking on the button, since to click you'll have to emulate mouse hovering and use javascript. Just load: https://sites.google.com/site/your-site/system/app/pages/createPage?source=/home

于 2013-03-10T23:01:00.020 回答
0

您可以尝试 Firefox 的 imacros 而不是 Chrome,因为在单击按钮方面,imacros 在 Mozilla Firefox 浏览器中的性能更好。

于 2019-06-05T21:55:58.393 回答
0

一种可能的解决方法是CLICK在 imacros 中使用该命令,如下所示:

VERSION BUILD=7601105 RECORDER=FX
TAB T=1
URL GOTO=https://sites.google.com/site/testing/
CLICK X=1000 Y=10

其中X是从浏览器左上角到您要点击的按钮中间的距离,Y是从浏览器顶部到您要点击的按钮中间的距离。您可以通过打印屏幕并进入诸如绘画之类的工具并测量像素距离(或您发现更方便的任何其他工具)来测量这些距离。

于 2017-01-11T19:23:34.750 回答
-1

也许您应该尝试单击该 div 内的跨度。也许这会触发动作。

VERSION BUILD=7601105 RECORDER=FX
TAB T=1
URL GOTO=https://sites.google.com/site/testing/
TAG POS=1 TYPE=SPAN ATTR=ID:sites-collaborator-bar-create-new-page-icon
于 2012-11-28T23:13:09.220 回答