import win.ui;
/*DSG{{*/
mainForm = win.form(text="采集";right=960;bottom=676)
mainForm.add(
button={cls="button";text="Button";left=808;top=632;right=951;bottom=666;db=1;dr=1;z=2};
custom={cls="custom";text="自定义控件";left=16;top=13;right=946;bottom=360;border=1;db=1;dl=1;dr=1;dt=1;z=1};
edtlog={cls="edit";left=6;top=368;right=800;bottom=670;autohscroll=1;autovscroll=1;db=1;dl=1;dr=1;edge=1;multiline=1;vscroll=1;z=3}
)
/*}}*/
import web.view
import godking.webPageOperation
var wb = web.view(mainForm.custom);
wb.go("http://hb.news.cn/xinxi/index.html");
mainForm.button.oncommand = function(id,event){
var wp = godking.webPageOperation( wb );
var list = wp.bySelectorS("#showData > li");
for(i=1;list.count();1){
var curdoc = list.byIndex(i);
var tm = curdoc.byClassNameS("domPC",1).getInnerText();
var title = curdoc.byTagNameS("a",1).getInnerText();
var url = curdoc.byTagNameS("a",1).getHref();
mainForm.edtlog.print(i, tm, title, url );
}
}
mainForm.show();
return win.loopMessage();