tools/保存ADI器件手册地址.aardio
2024-06-08 20:40:51 +08:00

59 lines
1.2 KiB
Plaintext

//修改网站页面
import win.ui;
import web.form;
/*DSG{{*/
var winform = win.form(text="aardio form";right=713;bottom=477;parent=...;scroll=1)
winform.add(
Go={cls="button";text="Go";left=569;top=38;right=608;bottom=71;z=4};
button={cls="button";text="Download";left=638;top=37;right=693;bottom=71;z=1};
edit={cls="edit";text="https://www.analog.com/en/parametricsearch/11010";left=52;top=41;right=555;bottom=65;edge=1;multiline=1;z=3};
static={cls="static";text="Static";left=32;top=128;right=677;bottom=443;db=1;dl=1;dr=1;dt=1;transparent=1;z=2}
)
/*}}*/
import web.form;
//创建web窗体
var wb = web.form( winform.static,,,,true );
wb.noScriptErr=true;
winform.show()
winform.button.oncommand = function(id,event){
var ele = wb.waitQueryEles(
//innerHTML="ADR1399";
//tagName="^A$";
href="//www.analog.com/en/.*";
//className="product"
target="_blank"
//rel="noopener noreferrer"
),10000;
//win.msgbox(ele.href++ "/datasheet")
var list = {}
for(k,v in ele){
var tmp = v.href ++ "/datasheet"++ '\r\n'
list[tmp] = list[tmp]==null?1:list[tmp] + 1
}
import console
console.dumpTable(list)
for(k,v in list){
string.save("d:\adi.txt",k ,true)
}
}
winform.Go.oncommand = function(id,event){
wb.go(winform.edit.text)
}
win.loopMessage();