Jump to content

Recommended Posts

Posted

Hi All,

I'm new to AutoIt and scripting, just finished some video tutorial on Udemy and ready to jump start my first project. What's a better way to learn than actually doing it right?

So I'm trying to write a script so that it fills out two selections in the same form on a web page and could not get the second one to work.  The first selection works out great, but I could not tell what is wrong. 

 

Any help is greatly appreciated!!

TG

 

Global $DocTranslator = "https://www.onlinedoctranslator.com/translationform"

$oIE = _IECreate()
_IENavigate($oIE, $DocTranslator)
_IELoadWait($oIE, $DocTranslator)
$Translation = _IEGetObjById($oIE, "translation-form")
$TranslationFrom = _IETagNameGetCollection($Translation, "select", 0)
$TranslationFrom.focus
_IEFormElementOptionSelect($TranslationFrom, "English", 1, "byText")
$TranslationTo = _IETagNameGetCollection($Translation, "select-to", 0)
$TranslationTo.focus
_IEFormElementOptionSelect($TranslationTo, "Dutch", 1, "byText")

Posted

Try this and spot the difference ;)

#include <IE.au3>

Global $DocTranslator = "https://www.onlinedoctranslator.com/translationform"

$oIE = _IECreate()
_IENavigate($oIE, $DocTranslator)
_IELoadWait($oIE, $DocTranslator)
$Translation = _IEFormGetObjByName($oIE, "translation-form")
$TranslationFrom = _IEFormElementGetObjByName($Translation, "from")
_IEFormElementOptionSelect($TranslationFrom, "English", 1, "byText")
$TranslationTo = _IEFormElementGetObjByName($Translation, "to")
_IEFormElementOptionSelect($TranslationTo, "Dutch", 1, "byText")

 

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...