iimPlay("CODE:URL GOTO=http://baidurank.aizhan.com/baidu/115.com/position/")
for (var i=1;i<27;i++)
{
iimSet("i",i);
var macro;
macro ="CODE: \n";
macro +="TAG XPATH=\"id('content')/div[1]/div[2]/div[4]/table/tbody/tr[{{i}}]/td[5]/a\" EXTRACT=HREF \n";
macro +="'PROMPT {{!EXTRACT}} \n";
macro +="'WAIT SECONDS=3 \n"
macro +="SAVEAS TYPE=EXTRACT FOLDER=R: FILE=test.csv \n";
iimPlay(macro);
}
推荐Firefo查看Xpath扩展:
XPath Checker:通过鼠标右键快速查看所在区域Xpath。
FirePath:Firebug的一个Xpath扩展,推荐。
怎么不能运行呢,报错:
SyntaxError: can not parse macro line: iimPlay("CODE:URL GOTO=网址替换掉,要不无法留言,就是代码中那个") (Error code: -910)