Since its appearance, Ruby has been accepted by more and more programmers. Here we will give you a detailed introduction to the techniques related to Ruby's win32ole call.
- Ruby module OpenURI to get http/FTP address content
- Analysis of Ruby encryption implementation code examples
- Ruby blocks provides flexible encoding methods
- Parse Json IN Ruby
- Ruby module Win32API calls win32API directly
For example, create an IE browser Ruby to call the win32ole instance.
- Require "win32ole"
- # Include library
- Ie = WIN32OLE. new ('internetex
Plorer. Application ')
- Ie. visible = true
- # At this time, you can see an ie interface.
- Ie. navigate ('HTTP: // mail.163.com ')
- # Go to this page
- Sleep (0.1) until ie. busy = false
- # Sleep until ie. busy is false and the page is fully loaded
- Ie. Document. getElementById ("username ")
. Value = "coderlee"
- # Enter the account name
- Ie. Document. getElementById ("password ")
. Value = "******"
- # Enter the password
- Ie. Document. getElementById ("btn1"). click
- # The login button id is btn1 simulated click
In fact, you can use the Interactive Programming Method to find a created ole object and input. ole_meth has implemented Ruby to call win32ole.