Jump to content

_IE Functions [SOLVED]


ken82m
 Share

Recommended Posts

This is my first time using the IE commands.

Does anyone see anything wrong with this code?

The page loads fine and I set the _IECreate command to wait for the page to load.

The _IEReadText returns 0 but the @error is 0. _IEReadHTML returned the same.

I do have IE8 but I compiled it and ran it on my desktop (IE7) and got the same result.

Thanks,

Kenny

#include <IE.au3>
#RequireAdmin

$IEObject = _IECreate("http://www.demonoid.com", 0, 1, 1, 0)

If $IEObject = 0 Then
   MsgBox(4096, "Demonoid Check", "Could not connect to Demonoid.com")
   Exit
EndIf

$IEBody = _IEBodyReadText($IEObject)
$IEBodyError = @error

If $IEBody = 0 Then
   MsgBox(4096, "Demonoid Check", "Errory reading body text" & @CR & "@error: " & $IEBodyError)
   Exit
EndIf

MsgBox(4096, "Demonoid Check", $IEBody)
Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Try (UPDATED 4:40)

#include <IE.au3>
#RequireAdmin
$IEObject = _IECreate("http://www.demonoid.com", 0, 1, 1, 0)


If $IEObject = 0 Then
   MsgBox(4096, "Demonoid Check", "Could not connect to Demonoid.com")
   Exit
EndIf

$IEBody = _IEBodyReadText($IEObject)
$IEBodyError = @error

If $IEBody = "" Then
   MsgBox(4096, "Demonoid Check", "Errory reading body text" & @CR & "@error: " & $IEBodyError)
  Else
      MsgBox(4096, "Demonoid Check", $IEBody)
EndIf

If it reads nothing on the page it will error, else it will display the text in the messagebox.

Edited by Klexen
Link to comment
Share on other sites

That did it. I don't see anything different except the the last parm on the IECreate and you moved the message box.

Strange, no idea why that If statement won't work. I just changed it to

If StringLen($IEBody) < 5 Then

What the hell I only need it for a few days lol

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Got it. Thanks :P

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

That did it. I don't see anything different except the the last parm on the IECreate and you moved the message box.

Strange, no idea why that If statement won't work. I just changed it to

If StringLen($IEBody) < 5 Then

What the hell I only need it for a few days lol

Your problem is doing a numeric compare with a string: If $IEBody = 0 Then

The string is converted to a number for the compare, and since it contains non-numeric text characters it is converted to 0. So you get a compare of 0 = 0.

Klexen changed it to: If $IEBody = "" Then

Although AutoIt is pretty loose with variable types, they do still matter.

:P

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