Jump to content

Help with stringsplit


Recommended Posts

I *** out a important url =)

but uh, basically there is something wrong with my stringsplit, that I can't figure out.

The text it's suppose to be parsing is ::

Logging in... OK sending a picture...got text for id=102/28934, type=0, to=0, text='garages explana'

I need it to ignore everything but whats inbetween the ''

example : garages explana

ignore the stupid "do" loop i got =)

Thanks for your help!

#Include <ScreenCapture.au3>
#Include "ie.au3"
opt("WinTitleMatchMode", 2)

$YesID = 'HaHa'
Do
WinWaitActive("Enter captcha for ")
$hGUI = wingethandle("Enter captcha for ")
_ScreenCapture_CaptureWnd ("C:\xampp\htdocs\1.jpg", $hGUI)
$oIE = _iecreate("http://******/bot/captcha/getCaptcha.php?url=http://91.121.175.94/1.jpg")
$text = _IEDocReadHTML ($oIE)
$d = stringsplit( $text, "'" )
$d = stringsplit( $d[2], "'" )
$text = $d[1];
msgbox (0,"", $d)

$YesID = 'NoNo'
until $YesID == 'NoNo'
Edited by DarkCloud
Link to comment
Share on other sites

I *** out a important url =)

but uh, basically there is something wrong with my stringsplit, that I can't figure out.

The text it's suppose to be parsing is ::

Logging in... OK sending a picture...got text for id=102/28934, type=0, to=0, text='garages explana'

I need it to ignore everything but whats inbetween the ''

example : garages explana

ignore the stupid "do" loop i got =)

Thanks for your help!

#Include <ScreenCapture.au3>

#Include "ie.au3"

opt("WinTitleMatchMode", 2)

$YesID = 'HaHa'

Do

WinWaitActive("Enter captcha for ")

$hGUI = wingethandle("Enter captcha for ")

_ScreenCapture_CaptureWnd ("C:\xampp\htdocs\1.jpg", $hGUI)

$oIE = _iecreate("http://******/bot/captcha/getCaptcha.php?url=http://91.121.175.94/1.jpg")

$text = _IEDocReadHTML ($oIE)

$d = stringsplit( $text, "'" )

$d = stringsplit( $d[2], "'" )

$text = $d[1];

msgbox (0,"", $d)

$YesID = 'NoNo'

until $YesID == 'NoNo'

Well we can't test that so maybe you could use

#include <string.au3>
;
;
$StringIwant = _StringBetween($text,"text='","'")
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I tried this, but the message box comes up blank..

Thanks for the fast reply and idea =)

#Include <ScreenCapture.au3>
#Include "ie.au3"
#include <string.au3>
opt("WinTitleMatchMode", 2)

$YesID = 'HaHa'
Do
WinWaitActive("Enter captcha for ")
$hGUI = wingethandle("Enter captcha for ")
_ScreenCapture_CaptureWnd ("C:\xampp\htdocs\1.jpg", $hGUI)
$oIE = _iecreate("http://66.90.101.177/bot/captcha/getCaptcha.php?url=http://91.121.175.94/1.jpg")
$text = _IEDocReadHTML ($oIE)
$StringIwant = _StringBetween($text,"text='","'")
msgbox (0,"", $StringIwant)

$YesID = 'NoNo'
until $YesID == 'NoNo'
Edited by DarkCloud
Link to comment
Share on other sites

Iv setup a another script that im using to trouble shoot, and I still can't get it working properly.

#include <IE.au3>
#Include <String.au3>
#Include <array.au3>

$oIE = _IECreate ("")

_IENavigate ($oIE, "http://91.121.175.94/test.html", 1)
$sHTML = _IEBodyReadHTML ($oIE)
    sleep(5000)
    $test1 = _StringBetween($sHTML, "text='", "'")
msgbox(0,"",$test1)

The msgbox comes up empty.

Can anyone please help me?!

Edited by DarkCloud
Link to comment
Share on other sites

Works for me... :)

$test = "Logging in... OK sending a picture...got text for id=102/39264, type=0, to=0, text='garages exolana'"
$array = StringRegExp($test, "text='(.*?)'", 1)

For $i = 0 To UBound($array) - 1
    MsgBox(0, "RegExp Test" & $i, $array[$i])
Next
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...