Wheezer

IE finding the value

9 posts in this topic

Hello guys!

I'm trying to let a value of a stock exchange appear in a message box.

After struggling for quite some time, i figured out how to find the id and class in a webpage.

But i got stuck.. how can i grab the value and make it appear in the msgbox? 

 

#include <IE.au3>

$oIE = _IEAttach("", "instance", 1)

$tags = $oIE.document.GetElementsByTagName("td")
For $tag in $tags
    $id_value = $tag.id
    If $id_value = "premium_exchange_stock_wood" Then
        MsgBox(0, "found ", $id_value)
    EndIf
Next

my code right now

I have added a picture to show what i'm trying to put out in the messagebox 

 

Wheezer

 

stock.png

Share this post


Link to post
Share on other sites



22 minutes ago, Jfish said:

I don't think it would be $id_value = $tag.id  (though I can't test without your site).  Try $id_value = $tag.innertext. 

Thank you for the quick reply, it runs but gives me no msgbox :(

#include <IE.au3>

$oIE = _IEAttach("", "instance", 1)


$tags = $oIE.document.GetElementsByTagName("td")
For $tag in $tags
    $id_value = $tag.innertext
    If $id_value = "premium_exchange_stock_wood" Then
        MsgBox(0, "found ", $tag.innertext)
    EndIf
Next

 

Share this post


Link to post
Share on other sites

Ahh i see, it needs to print out the innerText of the premium_exchange_stock_wood id.

But how:blink:

Share this post


Link to post
Share on other sites
2 hours ago, Jfish said:

What happened when you used the innertext property?  Can you post the URL so I can try?

It did not give me a messagebox or any output at all (strange) but you made me realise the values are in the innertext.

The stock is not free accessible but i made a screenshot to show how it looks

 

look.png

Share this post


Link to post
Share on other sites
1 hour ago, Danp2 said:

Try this:

#include <IE.au3>

$oIE = _IEAttach("", "instance", 1)

$oTD = _IEGetObjById($oIE, "premium_exchange_stock_wood")

MsgBox(0, "found", $oTD.innertext)

 

Hooray this works!!:lmao:

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