How to call win32ole IN Ruby

Source: Internet
Author: User

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.

  1. Require "win32ole"
  2. # Include library
  3. Ie = WIN32OLE. new ('internetex
    Plorer. Application ')
  4. Ie. visible = true
  5. # At this time, you can see an ie interface.
  6. Ie. navigate ('HTTP: // mail.163.com ')
  7. # Go to this page
  8. Sleep (0.1) until ie. busy = false
  9. # Sleep until ie. busy is false and the page is fully loaded
  10. Ie. Document. getElementById ("username ")
    . Value = "coderlee"
  11. # Enter the account name
  12. Ie. Document. getElementById ("password ")
    . Value = "******"
  13. # Enter the password
  14. Ie. Document. getElementById ("btn1"). click
  15. # 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.