Jump to content

How whould I read this one line? Website.


Go to solution Solved by somdcomputerguy,

Recommended Posts

Untitled.png

I googled and tried several differnt things (I'm not very skilled basicly cut and past).

This being the closest I think I came:

#include <IE.au3>

$oIE = _IECreate("The website")

$CurrentLevel = ""

$tags = $oIE.document.GetElementsByTagName("div")
For $tag in $tags
$class_value = $tag.GetAttribute("class")
If string($class_value) = "profileXpLevel" Then $CurrentLevel=IEBodyReadText($class_value)


MsgBox(0, "Level: ", $CurrentLevel)
    ExitLoop


Next

The msgbox comes up empty.

It gets to the <div class="profileXpLevel"> (I think) but Idk how to read the <h5>Level 187</h5> inside of it?

Edited by Neeeewbie
Link to comment
Share on other sites

  • Moderators

Hi, Neeeewbie. Is the site public where you can post a link, or can you please post the full HTML. You should be able to read the inner text, but it is difficult to tell from just that small snippet.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Solution

I posted in a similar topic not to long ago with code that does work, but probably can be done more efficiently. Especially with some of the IE functions. But here it goes anyway..
 

#include <INet.au3>
#include <String.au3>

Opt('MustDeclareVars', 1)

Local $URL = "", $Needle, $Haystack, $Needle_Start, $Needle_End

$Haystack     = _INetGetSource($URL)
$Needle_Start = '<div class="profileXpLevel"><h5>'
$Needle_End   = '</h5></div>'
$Needle       = _StringBetween($Haystack, $Needle_Start, $Needle_End)

MsgBox(4096, 'Needle in a Haystack', $Needle[0])

Note to edit the $URL variable accordingly. This is the post I made before - , feel free to try it out if you care.

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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