Jump to content

Scripting Query


Recommended Posts

Hi Guys/Gals,

Is it possible to select a specific link on a webpage say www.google.com, "images" on a webpage that is already been created. I.e

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com"); This part omitted

$sMyString = "wallpaper"

$oLinks = _IELinkGetCollection($oIE)

For $oLink in $oLinks

$sLinkText = _IEPropertyGet($oLink, "innerText")

If StringInStr($sLinkText, $sMyString) Then

_IEAction($oLink, "click")

ExitLoop

EndIf

Next

Cheers.

http://www.autoitscript.com/forum/style_im...icons/icon1.gif

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

Hi Guys/Gals,

Is it possible to select a specific link on a webpage say www.google.com, "images" on a webpage that is already been created. I.e

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com"); This part omitted

$sMyString = "wallpaper"

$oLinks = _IELinkGetCollection($oIE)

For $oLink in $oLinks

$sLinkText = _IEPropertyGet($oLink, "innerText")

If StringInStr($sLinkText, $sMyString) Then

_IEAction($oLink, "click")

ExitLoop

EndIf

Next

Cheers.

http://www.autoitscript.com/forum/style_im...icons/icon1.gif

_IECreate has an option to attach to existing window. It's just off by default.

Link to comment
Share on other sites

Hi Guys Gals ,

Sorry I thought it I had it working, I am trying to get a basic script running to get a feel for the Ie_Attach command. Can someone tell me whats wrong with this.

#include <IE.au3>

$oIE = _IEAttach("Google - Microsoft Internet Explorer")

$oForm = _IEFormGetObjByName ($oIE, "f")

$oQuery = _IEFormElementGetObjByName ($oForm, "q")

_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")

_IEFormSubmit ($oForm)

When I load the script nothing happens.

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

Hi Guys Gals ,

Sorry I thought it I had it working, I am trying to get a basic script running to get a feel for the Ie_Attach command. Can someone tell me whats wrong with this.

#include <IE.au3>

$oIE = _IEAttach("Google - Microsoft Internet Explorer")

$oForm = _IEFormGetObjByName ($oIE, "f")

$oQuery = _IEFormElementGetObjByName ($oForm, "q")

_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")

_IEFormSubmit ($oForm)

When I load the script nothing happens.

Look at the parameters for _IEAttach() in the help file. The default match is the DOCUMENT TITLE, not the WINDOW TITLE. It will work if you do this:
$oIE = _IEAttach("Google - Microsoft Internet Explorer", "WindowTitle")

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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