开发者

Send keys to a twebbrowser?

How do I programatically send keys to a TWebBrowser to fill in data fiel开发者_StackOverflow社区ds like Name and address?


If you want to fake input you need to use the SendInput API.

However, that's going to require you to make sure that field in question has the input focus. I suspect you would be better off poking the data in through the DOM (IWebBrowser2.Document).


I guess you want just to fill in some data in some edit boxes. If yes, this might be useful for you http://delphi.about.com/od/twebbrowser/a/submit_web_form_2.htm


The most robust way would be to use the DOM as suggested previously. However if you end up going via the simulated input route, the Delphi SendKeys unit will make things much easier. Article and download available here: http://delphi.about.com/od/adptips2004/a/bltip1104_3.htm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜