bills4 Posted December 12, 2011 Posted December 12, 2011 i have a string<select class="bottle_quantity" name="bottle_quantity-150967">i want to cut this string bottle_quantity-150967how can to cut iti try this code but is not working .................._IELoadWait ($oIE)Local $sData = _IEBodyReadText($oIE)$string=_StringBetween($sData,'<select class="bottle_quantity" name="','">')MsgBox(4096, "", "Bytes read: " & $nBytesRead & @CRLF & @CRLF & $string)
UEZ Posted December 12, 2011 Posted December 12, 2011 Try this: $sData = '<select class="bottle_quantity" name="bottle_quantity-150967">' $string = StringRegExpReplace($sData, '.*name="(.*)">', "$1") $nBytesRead = 1024 MsgBox(4096, "", "Bytes read: " & $nBytesRead & @CRLF & @CRLF & $string) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
bills4 Posted December 13, 2011 Author Posted December 13, 2011 thank it working for your example but it is not working on my work because i view soure of 1 webpage have so much string/this is examplei want take this string on this page : autoit-v3.3.7.22#include <string.au3>#include <IE.au3>$oIE = ObjCreate("InternetExplorer.Application")$oIE.visible = True$oIE.Navigate("http://www.autoitscript.com/autoit3/files/beta/update.dat")_IELoadWait ($oIE)Local $sData = _IEBodyReadText($oIE)Local $nBytesRead = @extended$string=_StringBetween($sData,'setup=http://www.autoitscript.com/autoit3/files/beta/autoit/','-beta-setup.exe')MsgBox(4096, "", "Bytes read: " & $nBytesRead & @CRLF & @CRLF & $string)but it is not working
enaiman Posted December 13, 2011 Posted December 13, 2011 (edited) Do your homework This comes from help file _StringBetween: Return Value Success:A 0 based $array[0] contains the first found string.Now apply this to your result. Edited December 13, 2011 by enaiman SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
UEZ Posted December 13, 2011 Posted December 13, 2011 Then try this: #include <string.au3> #include <IE.au3> $oIE = ObjCreate("InternetExplorer.Application") $oIE.visible = True $oIE.Navigate("http://www.autoitscript.com/autoit3/files/beta/update.dat") _IELoadWait ($oIE) Local $sData = _IEBodyReadText($oIE) Local $nBytesRead = @extended ;~ $string=_StringBetween($sData,'setup=http://www.autoitscript.com/autoit3/files/beta/autoit/','-beta-setup.exe') $aString=StringRegExp($sData,"setup=.*/beta/autoit/(autoit.*[d+])",3) MsgBox(4096, "", "Bytes read: " & $nBytesRead & @CRLF & @CRLF & $aString[0]) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
bills4 Posted December 13, 2011 Author Posted December 13, 2011 @enaiman thank you i knew why it is not working now @UEZ thanks for your example it make me know why it is not working thank for all
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now