Jump to content
Sign in to follow this  
sambalec

FF.au3 _FFCmd() Get first url image

Recommended Posts

sambalec

Hello, I'm not very good with javascript elements, can you help me to have the logo link of google with FFCmd() function ?

CODE
#Include <FF.au3>

_FFStart()

If _FFIsConnected() Then

_FFOpenURL("http://www.google.com")

; href from an image link

$sHref = _FFCmd(".images[0].href")

If Not @error Then MsgBox(64,"Href of the first image-link:",$sHref)

Else

MsgBox(64,"Error:","Can't conncect to FireFox")

EndIf

My script isn't work, my problem is _FFCmd(".images[0].href") it's not correct.

Many thanks !

Edited by sambalec

Share this post


Link to post
Share on other sites
Stilgar

Hello, I'm not very good with javascript elements, can you help me to have the logo link of google with FFCmd() function ?

CODE
#Include <FF.au3>

_FFStart()

If _FFIsConnected() Then

_FFOpenURL("http://www.google.com")

; href from an image link

$sHref = _FFCmd(".images[0].href")

If Not @error Then MsgBox(64,"Href of the first image-link:",$sHref)

Else

MsgBox(64,"Error:","Can't conncect to FireFox")

EndIf

My script isn't work, my problem is _FFCmd(".images[0].href") it's not correct.

Many thanks !

There are no "href" attribute for images. I think you mean "src":

(<img src="image.png">)

$sHref = _FFCmd(".images[0].src") ; index 0-n
; or
$sHref = _FFXpath("//img[1]","src",9) ; index 1-n

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.