Jump to content

[FF.au3] Get value by ID


Recommended Posts

Hello,

I'm using FF.au3 from topic and I want to get value by ID.

HTML code:

<div id="SomeID" tip="Text of tip">Text</div>

I want to get "Text" (and "Text of tip" if it is possible).

$sInput = _FFObjGet("SomeID", "id"); Returns a string
$Val = _FFObj($sInput, "id"); 
MsgBox(64, "Value by ID", $Val)

It works but:

_FFObj($sInput, "id")
returns "Some ID"

_FFObj($sInput, "value")
returns nothing.

Thanks for help :)

PS: _FFGetValueById doesn't work too.

Edited by Adrian777
Link to comment
Share on other sites

Hello,

I'm using FF.au3 from topic and I want to get value by ID.

HTML code:

<div id="SomeID" tip="Text of tip">Text</div>

I want to get "Text" (and "Text of tip" if it is possible).

$sInput = _FFObjGet("SomeID", "id"); Returns a string
$Val = _FFObj($sInput, "id"); 
MsgBox(64, "Value by ID", $Val)

It works but:

_FFObj($sInput, "id")
returns "Some ID"

_FFObj($sInput, "value")
returns nothing.

Thanks for help :)

PS: _FFGetValueById doesn't work too.

Hello,

there's no attribute "value" in this "div", so _FFObj returns nothing.

If you wanna have the "text" in this division you must use "textContent" not "value".

_FFGetValueById is deprecated -> please use _FFGetValue("SomeID", "id") instead.

And for the "tip":

$sInput = _FFObjGet("SomeID", "id")
$sTip = _FFObj($sInput, "tip")

Stilgar

Edited by Stilgar
Link to comment
Share on other sites

@Stilgar

Thanks for reply. Before you posted I try to use _FFReadHTML() and search string (it's very slow).

$sInput = _FFObjGet("SomeID", "id")
$sTip = _FFObj($sInput, "textContent")

It works great but only for "textContent". With tip returns nothing.

Edited by Adrian777
Link to comment
Share on other sites

@Stilgar

Thanks for reply. Before you posted I try to use _FFReadHTML() and search string (it's very slow).

$sInput = _FFObjGet("SomeID", "id")
$sTip = _FFObj($sInput, "textContent")

It works great but only for "textContent". With tip returns nothing.

Have you the console-output for the problem with the "tip", too, please?

Yes, _FFReadHTML is very slow. The fastest function to get informations like that is _FFXpath:

$sText = _FFXpath("//div[@id='SomeID']", "textContent", 2)

Stilgar

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...