我正在实现 java 脚本以从网站检索值,它在 java 脚本循环中提取了一半的数据,但相同的参数从网站中提取了完整的数据。
在这里,我得到 type:SPAN 的值,但从 div 我只得到标题,没有别的
macro +="TAG POS=1 TYPE=DIV ATTR=CLASS:title" + "\n";
为了
macro +="TAG POS=1 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=2 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=3 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=4 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=5 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
它在 csv 中为空白。错误在哪里?请帮助我或建议任何其他方式来实现相同的。在此先感谢。
完整代码:
var macro1;
macro1 = "CODE:";
macro1 += "VERSION BUILD=8011895" + "\n";
macro1 += "TAB T=1" + "\n";
macro1 += "URL GOTO=http://www.example.com/ " + "\n";
var macro;
macro = "CODE:";
macro +="TAG POS={{n}} TYPE=A ATTR=CLASS:title" + "\n";
macro +="TAG POS=1 TYPE=DIV ATTR=CLASS:title" + "\n";
macro +="TAG POS=1 TYPE=DIV ATTR=CLASS:title EXTRACT=TXT" + "\n";
macro +="TAG POS=1 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=2 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=3 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=4 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=5 TYPE=DIV ATTR=CLASS:category EXTRACT=TXT" + "\n";
macro +="TAG POS=1 TYPE=H3 ATTR=CLASS:tg<SP>ui-h3 EXTRACT=TXT" + "\n";
macro +="TAG POS=1 TYPE=SPAN ATTR=CLASS:name EXTRACT=TXT" + "\n";
macro +="TAG POS=1 TYPE=SPAN ATTR=CLASS:no EXTRACT=TXT" + "\n";
macro += "SAVEAS TYPE=EXTRACT FOLDER=* FILE=Extract.csv" + "\n";
macro += "BACK" + "\n";
iimPlay(macro1)
for (var n=1;n<10;n++)
{
iimSet("n",n)
iimPlay(macro)
}