find all _stringbetween occurrences within a webpage

803 views Asked by At

I am working on an AutoIT script to find select messages withing a chatroom type webpage, I have no problem with placing the sent text between two special characters to make them easier to find, also to filter out all of the unwanted stuff. the problem that I am having is once the _stringbetween finds what it is looking for it doesn't continue looking. For testing I have the values returning in a GUI box. If there is a way to return all text between "^","^" it would solve my problem. Here is what i have so far

    $html = _StringBetween(_INetGetSource('https://dtss.campfirenow.com/room/595835'), '^','^')
    MsgBox(0, "title", $html[0])

also if anyone knows of a better way to pull select messages from campfire that would also solve my problem, maybe using the star feature... If you would like to look at the source code and api's of campfire they are available on GitHub

1

There are 1 answers

0
SachaDee On BEST ANSWER

The _stringbetween return all occurences it will find. You can make this simple test.

#include <array.au3>
$source="^test1^blabla^test2^blabla^test3^blabla^test4^blabla^test5^blabla"
$aRes=_StringBetween($Source,"^","^")
_ArrayDisplay($aRes)

For your source I don't now what's happening but test like this :

#include <array.au3>
$Source = BinaryToString(InetRead("https://dtss.campfirenow.com/room/595835"))
$aRes=_StringBetween($Source,"^","^")
_ArrayDisplay($aRes)

If the problem persist make a paste of your source code's page and post the link.