Jump to content
Sign in to follow this  
Arclite86

_StringBetween getting error

Recommended Posts

Arclite86

I am trying to run this code:

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

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

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

the error:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\joesoef pc\Desktop\autoit\youtube.au3" /UserParams    
+>11:30:21 Starting AutoIt3Wrapper v.2.1.4.4 SciTE v.3.3.7.0 ;  Keyboard:00020409  OS:WIN_81/  CPU:X64 OS:X64    Environment(Language:0413  Keyboard:00020409  OS:WIN_81/  CPU:X64 OS:X64)
>Running AU3Check (1.54.22.0)  from:C:\Program Files (x86)\AutoIt3
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(136,69) : ERROR: syntax error
            ConsoleWrite(_StringBetween($oInput.innerHTML(),'>','<')[
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(148,70) : ERROR: syntax error
            ConsoleWrite(_StringBetween($oInput2.innerHTML(),'>','<')[
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(153,60) : ERROR: syntax error
$numbvolgers = (_StringBetween($oInput.innerHTML(),'>','<')[
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(153,62) : ERROR: unbalanced paranthesis expression.
$numbvolgers = (_StringBetween($oInput.innerHTML(),'>','<')[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(154,61) : ERROR: syntax error
$numbvolgend = (_StringBetween($oInput2.innerHTML(),'>','<')[
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(154,63) : ERROR: unbalanced paranthesis expression.
$numbvolgend = (_StringBetween($oInput2.innerHTML(),'>','<')[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3(136,68) : ERROR: _StringBetween(): undefined function.
            ConsoleWrite(_StringBetween($oInput.innerHTML(),'>','<')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\joesoef pc\Desktop\autoit\youtube.au3 - 7 error(s), 0 warning(s)
!>11:30:21 AU3Check ended. Press F4 to jump to next error.rc:2
+>11:30:21 AutoIt3Wrapper Finished..
>Exit code: 2    Time: 0.692

it seems the problem has to do with the string function,

I am  using autoit Version 3.3.7

because when i run version 3.3.10.2 firefox won't work any more

can somebody please help me with this.

Share this post


Link to post
Share on other sites
mikell

With 3.3.7 you can't use this syntax

$txt = _StringBetween($oInput.innerHTML(),'>','<')[0]

You must use

$a = _StringBetween($oInput.innerHTML(),'>','<')
$txt = $a[0]

and don't forget the include #include <String.au3>

Edited by mikell

Share this post


Link to post
Share on other sites
Arclite86

With 3.3.7 you can't use this syntax

$txt = _StringBetween($oInput.innerHTML(),'>','<')[0]

You must use

$a = _StringBetween($oInput.innerHTML(),'>','<')
$txt = $a[0]

and don't forget the include #include <String.au3>

thak you but how can i give this code

$a = _StringBetween($oInput.innerHTML(),'>','<')
$txt = $a[0]

a name just like I did with this 

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

$numbvolgend

Share this post


Link to post
Share on other sites
guinness

Upgrade!


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Arclite86

Upgrade!

but than i wont be able to use firefox

Share this post


Link to post
Share on other sites
FireFox

Learn the basics before making a NPP.


 

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

Learn the basics before making a NPP.

the  3.3.10.2 version has a bug with running firefox, I already discussed that in the Example script topic

the  3.3.7 Version has a problem with _StringBetween

how am I suppose too learn the basics form that?? what kind of advise is that?

Share this post


Link to post
Share on other sites
FireFox

This is NOT a bug.

Arrays direct access is a new feature not available in 3.3.7, that's all.

Like mikell showed you, use a temporary variable.

If you don't want to read advices, what can we do for you?

Edited by 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
mikell

#include <String.au3>
$a = _StringBetween($oInput2.innerHTML(), '>', '<')
$numbvolgend = $a[0] & @CRLF

BTW I can't see the connection between an Autoit upgrade and a trouble using a browser

Edit

At least use 3.3.8.1

Edited by mikell

Share this post


Link to post
Share on other sites
guinness

but than i wont be able to use firefox

Then don't use the non-existent feature in that version.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Arclite86

Then don't use the non-existent feature in that version.

 

I have have imported this string.au file  dont know if this is the right file but it dind't work, could somebody tell me what function I have to include that has too do with the "String" function so I can make this function work in v3.3.7 and run firefox, by the way I also discussed this problem/bug in the  >Example script topic (you can see my post over there (page30))

 

 

#include <String.au3>
$a = _StringBetween($oInput2.innerHTML(), '>', '<')
$numbvolgend = $a[0] & @CRLF

BTW I can't see the connection between an Autoit upgrade and a trouble using a browser

Edit

At least use 3.3.8.1

see my posts >Example script topic (page30)

I did remember that I downloaded v3.3.8.1 because  v3.3.7 doesn't exist on the download page...

using the string function was just a way to read the title ( title = number 964)

<strong title="964" class="js-mini-profile-stat">964</strong>

if somebody know an other way to read this title with an other function than my question would also be answered :)

Share this post


Link to post
Share on other sites
FireFox

I have have imported this string.au file dont know if this is the right file but it dind't work

It has nothing to deal with includes, it's the interpretor which recognizes the syntax or not.

As we said you need to update to the latest autoit stable to use this feature.

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
FireFox

You may also need to update the SciTE4AutoIt package in case the Au3Check is not included in the autoit setup stuff.

Edited by 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

You may also need to update the SciTE4AutoIt package in case the Au3Check is not included in the autoit setup stuff.

Before i do that can I get some help with reading a function

<strong title="964" class="js-mini-profile-stat">964</strong>

this would save time instead of installing and testing all the time,

I have tried to use "_FFObjGet" but it cant track title's

does anybody know how to read the function (than put it in a message box)

the full code:

<a class="js-nav" href="/followbacklist3/followers" data-element-term="follower_stats" data-nav="followers" data-is-compact="false">Volgers<strong title="966" class="js-mini-profile-stat">966</strong> </a>
Edited by Arclite86

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  

×