Jump to content
Sign in to follow this  
Arclite86

gives error shuts down form

Recommended Posts

Arclite86

this is the code I try to run:

Func volgerteller()

$link = GUICtrlRead($List1)

        $oIE = _IECreate("https://twitter.com/"&$link,1,0)   ;linkkk

$oInput2s = _IETagNameGetCollection($oIE, "a")
For $oInput2 In $oInput2s
    If $oInput2.className() = "js-nav" Then
        If StringInStr($oInput2.innerHTML(), 'Volgend') Then
            ConsoleWrite(_StringBetween($oInput2.innerHTML(),'>','<')[0] & @CRLF)
            ExitLoop
        EndIf
    EndIf
Next

$numbvolgers = (_StringBetween($oInput2.innerHTML(),'>','<')[0] & @CRLF)

GUICtrlSetData($List2,"volgers"& $numbvolgers )
if @error then MsgBox(0, "", "gevonden" )

if I remove this line it doesn't shuts down immediately ( but the function will not work)

$numbvolgers = (_StringBetween($oInput2.innerHTML(),'>','<')[0] & @CRLF)

GUICtrlSetData($List2,"volgers"& $numbvolgers )

so it has something to do with the last 2 lines,

this is the error that i get:

+>16:23:00 AU3Check ended.rc:0
>Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\joesoef pc\Desktop\autoit\program\test.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
"C:\Program Files (x86)\AutoIt3\Include\String.au3" (42) : ==> Subscript used on non-accessible variable.:
Func _StringBetween($sString, $sStart, $sEnd, $fCase = False)
Func _StringBetween($sString, $sStart, $sEnd, $fCase = False^ ERROR
->16:23:00 AutoIt3.exe ended.rc:1
+>16:23:00 AutoIt3Wrapper Finished..
>Exit code: 1    Time: 1.065 

 yesterday it worked fine I saved it, now I start the code and the form direclty shuts down..

Edited by Arclite86

Share this post


Link to post
Share on other sites
FireFox

Hi,

The error means the _StringBetween return value is not an array.

So in your $oInput2.innerHTML(), the _StringBetween function hasn't found the delimiters >, <.

And because it's a remote resource (and especially a dynamic website) it can change ;)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Arclite86

Hi,

The error means the _StringBetween return value is not an array.

So in your $oInput2.innerHTML(), the _StringBetween function hasn't found the delimiters >, <.

And because it's a remote resource (and especially a dynamic website) it can change ;)

Br, FireFox.

aa alright thank you very much firefox, but how did you know the >,< was the problem?

Share this post


Link to post
Share on other sites
FireFox

The answer is in my post, follow my deduction.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Arclite86

I have got a new strange problem, if use, $oIE = _IECreate("https://twitter.com/"&$link,1,0) it doesnt work it shuts down direclty and give's a error :

"C:\Users\user pc\Desktop\autoit\programma\teller.au3" (43) : ==> Variable must be of type "Object".:
$numbvolgers = (_StringBetween($oInput2.innerHTML(),'>','<')[0] & @CRLF)
$numbvolgers = (_StringBetween($oInput2^ ERROR

but if i use

$oIE = _IECreate("https://twitter.com/"&$link) without the ,1,0, it does work,

but i dont want 10 browser to pop up every time has somebody a sollution for this strange problem.

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
Sign in to follow this  

×