Jump to content
Sign in to follow this  

Get Image Url

Recommended Posts


Im using this code

InetGet($url, "1.jpg", 1)

and it works great but im wondering how I can make my _Ie processes pull the url of a image and insert it into autoit for me as $url

basicly how can I make autoit read the html of a webpage and find a certin url. almost like by the value.

The image also has a alt text if that may or may not help.

I know i can have autoit click a image by its alt text dont know if I can have it pull it because of it. Thank You

Share this post

Link to post
Share on other sites

Try _IEPropertyGet() for "locationurl".


Edit: Actually for images the .src property is more useful:

#include <IE.au3>

$sURL = "http://www.autoitscript.com"
$oIE = _IECreate($sURL)
$colImages = _IEImgGetCollection($oIE)
For $oImage In $colImages
    ConsoleWrite("Url = " & _IEPropertyGet($oImage, "locationurl") & @LF)
    ConsoleWrite("Src = " & $oImage.src & @LF)

The locationurl property is just the parent window's URL, not the element's.


Edited by PsaltyDS

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

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.