Jump to content

Why am I getting this error?


Recommended Posts

After the script runs for awhile, I will get this error

$oLink.href ^ Error

Here is my code below:

#include <IE.au3>
Dim $oIE, $url, $count, $wintitle

$url = "http://forum.idwpublishing.com"
$listurl = "/memberlist.php?mode=joined&order=ASC&start="
$count = 42350

HotKeySet("{F2}", "Terminate")

Func Terminate()
    Exit 0
EndFunc

Do
    
$wintitle = WinGetTitle("[Class:IEFrame]", "")

$oIE = _IEAttach($wintitle, "WindowTitle")
_IENavigate($oIE,$url&$listurl&$count)
_IELoadWait($oIE)

$oLinks = _IELinkGetCollection($oIE)
$iNumLinks = @extended
Dim $a_links[1] = [0]
;MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
   ;MsgBox(0, "Link Info", $oLink.href)
    $a_links_size = UBound($a_links)
    ReDim $a_links[$a_links_size + 1]
    $a_links[0] = $a_links_size
    $a_links[$a_links_size] = $oLink.href
Next

For $x = 1 To $a_links[0]
    If StringInStr($a_links[$x], "mailto:") Then FileWrite("list.txt",StringTrimLeft($a_links[$x],7)&@CRLF)
Next

$count += 50

Until $count = 50526 + 50
Link to comment
Share on other sites

After the script runs for awhile, I will get this error

$oLink.href ^ Error

Here is my code below:

#include <IE.au3>
Dim $oIE, $url, $count, $wintitle

$url = "http://forum.idwpublishing.com"
$listurl = "/memberlist.php?mode=joined&order=ASC&start="
$count = 42350

HotKeySet("{F2}", "Terminate")

Func Terminate()
    Exit 0
EndFunc

Do
    
$wintitle = WinGetTitle("[Class:IEFrame]", "")

$oIE = _IEAttach($wintitle, "WindowTitle")
_IENavigate($oIE,$url&$listurl&$count)
_IELoadWait($oIE)

$oLinks = _IELinkGetCollection($oIE)
$iNumLinks = @extended
Dim $a_links[1] = [0]
;MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
  ;MsgBox(0, "Link Info", $oLink.href)
    $a_links_size = UBound($a_links)
    ReDim $a_links[$a_links_size + 1]
    $a_links[0] = $a_links_size
    $a_links[$a_links_size] = $oLink.href
Next

For $x = 1 To $a_links[0]
    If StringInStr($a_links[$x], "mailto:") Then FileWrite("list.txt",StringTrimLeft($a_links[$x],7)&@CRLF)
Next

$count += 50

Until $count = 50526 + 50

I would expect a "Logical Computer Tech" to post the full error text, and not just one line of it...

: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

That is the only error I am getting, then the script just quits. That is why I am asking on the forums, if I had more details, I would not be posting or at least try to figure it out first. I am running the script through SciTE and all the log says is that error and nothing else.

Thanks

Link to comment
Share on other sites

That is the only error I am getting, then the script just quits. That is why I am asking on the forums, if I had more details, I would not be posting or at least try to figure it out first. I am running the script through SciTE and all the log says is that error and nothing else.

Thanks

Actually you need to post TWO lines-- the one you posted and the one right above it.

The little caret (^) is actually a pointer to the character where AutoIt found the error, in the line above.

Link to comment
Share on other sites

Thanks for the reply, a lot more helpful than PsaltyDS reply. I did notice, if I do it to a different website, I would not get the error, or it would take longer to get the error. Must have to do with the server, guess I will just have to put a few Sleep() commands in the script.

Thanks Again

Link to comment
Share on other sites

Actually you need to post TWO lines-- the one you posted and the one right above it.

The little caret (^) is actually a pointer to the character where AutoIt found the error, in the line above.

All it said above it was $oLink.href and nothing else. That was only two lines it outputted, but if that makes a difference next time I have a error I will make sure to include it.

$oLink.href
$oLink.href ^ Error

Thought I would just include it anyways, but doesn't add any more clarification to the error.

Link to comment
Share on other sites

I just tried out the script and it seemed it worked fine. Did exactly what it was supposed to do-- just extracts all e-mail addresses from all members and dumps them to a text file.

Using AutoIt v3.3.0.0.

Link to comment
Share on other sites

Suggest you instatiate a COM error handler and see if you can get more information about the underlying cause. Start with _IEErrorHandlerRegister() using the default and if that isn't enough, then use _IEErrorHandlerRegister("yourErrorHandler") to trap the error condition and examine current variable values etc... also suggest SciTe Debug mode. Make sure you run in SciTe.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I just tried out the script and it seemed it worked fine. Did exactly what it was supposed to do-- just extracts all e-mail addresses from all members and dumps them to a text file.

Using AutoIt v3.3.0.0.

How long did you run the script for?

And as for the Error Handling, going to give that a try now.

Thanks Everyone.

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