- #加载库
- use Win32::IEAutomation;
- use Win32::IEAutomation::WinClicker;
- use Win32::IEAutomation::Element;
- my $ie = Win32::IEAutomation->new(visible =>1);
- #浏览网站
- $ie -> gotoURL('http://130.1.1.1/sdg001.htm?ruijie_query_id=sdg&');
- $ie -> WaitforDone();
- #获取select对象,选择test1
- $ie -> getSelectList("name:",'command') -> SelectItem('test1');
- # IE 6
- use Win32::GuiTest qw(:ALL);
- Gui_Set_ForegroundWindow("Internet Explorer");
- my @windows = FindWindowLike(0,"Microsoft Internet Explorer");
- SetForegroundWindow($windows[0]);
- for(1..3){
- SendKeys("{TAB}");
- }
- SendKeys("{ENTER}");
- SendKeys("{ENTER}");
- $ie -> closeIE();
- #删除ie 进程
- system "taskkill /f /im IEXPLORE.EXE";
- # #
- ## IE 8
- use Win32::GuiTest qw(:ALL);
- Gui_Set_ForegroundWindow("Internet Explorer");
- my @windows = FindWindowLike(0,"Microsoft Internet Explorer");
- SetForegroundWindow($windows[0]);
- for(1..8){
- SendKeys("{TAB}");
- }
- foreach(1..4){
- SendKeys("{ENTER}");
- }
- $ie -> closeIE();
- #删除ie 进程
- system "taskkill /f /im IEXPLORE.EXE";
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。