Blog信息 |
blog名称:注册会计师(注会)练习软件 日志总数:398 评论数量:116 留言数量:27 访问次数:3265586 建立时间:2005年6月6日 |

| |
[delpih编程]webbrowse自动填表及发博客 软件技术
吕向阳 发表于 2009/3/12 0:22:14 |
procedure TForm8.WebBrowser1DocumentComplete(Sender: TObject;const pDisp: IDispatch; var URL: OleVariant);varvtag, vdoc, o: Olevariant;// : IHTMLElement;i: integer;HtmlDoc: IHTMLDocument2;myitem: Olevariant;str1: string;beginif url = 'http://blogger.org.cn/blog/user_login.asp' thenbegino := WebBrowser1.OleObject.document.all.item('username'); //找到登录用户名的输入框o.value := 'lxxxxx';o := WebBrowser1.oleobject.document.all.item('password'); //找到登录密码的输入框o.value := 'ppppppwd';WebBrowser1.oleobject.document.all.item('submit', 0).click; //第一个表单提交end;if url = 'http://blogger.org.cn/blog/user_addblog.asp' thenbeginstr1 := '';for i := 0 to richedit1.Lines.Count - 1 dobeginstr1 := str1 + richedit1.Lines[i] + '';end;o := WebBrowser1.OleObject.document.all.item('topic'); //找到登录用户名的输入框o.value := edit1.text;o := WebBrowser1.oleobject.document.all.item('subjectid'); //找到登录密码的输入框o.value := 3532;o := WebBrowser1.oleobject.document.all.item('classid14'); //找到登录密码的输入框o.checked := true;WebBrowser1.OleObject.document.getElementById('oblog_Composition').contentWindow.document.body.innerHTML := str1;tryWebBrowser1.oleobject.document.all.item('submit2', 0).click; //第一个表单提交exceptend;edit1.Clear;richedit1.Lines.Clear;end;end; |
|
|