Sign in to follow this  
Followers 0
bills4

how can get this string

6 posts in this topic

i have a string

<select class="bottle_quantity" name="bottle_quantity-150967">

i want to cut this string bottle_quantity-150967

how can to cut it

i 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)

Share this post


Link to post
Share on other sites



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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

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 example

i 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 :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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 :)

Share this post


Link to post
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

@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

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  
Followers 0