A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[Req] Extract Multiple link

820 views · started by Bman ·
#1
[Req] Extract Multiple link
I was wondering if someone could help me with extracting multiple links and adding them to a list box...

for example :

Getting the link between some text in the html coding(strhtml)

With the httpwrappers, and addint it to a listbox..

I will give credits, I just need some help.

I want it to go through StrHtml(Html coding) and extract the text between two variables,(getstringbetween) then add it to the listbox, And continue until there are none left.
#2
I don't know anything about visual basic, but I would use a command to find the number of instances of "<a href=" and do something like
if (substr($link, 7) != "http://") {
$link = $baseurl.$link;
}


I don't know anything about visual basic, so I can't show you an exact example, but the rundown would be as follows:
1.) Count instances of "<ahref=" ignoring all white space so as to avoid glitches due to line breaks
2.) Use a for statement such as for ($i = 1; $i <= $NumberFound; $i++) {/*Add them all to array*/}
3.) Grab the variables
4.) for ($i = 1; $i <= $NumberFound; $i++) {_AddToListBox($Array[$i])}
#3
Thats the problem, i dont know how to get that working.. ive tried quite a few things.. maybe arti can help me.

But ugh, thanks for the help anyways :)
#4
in vb6 wrappers should include a thing called "Addons" or "Stuff" Should be one of those

Addons.ExtractAll(StrHTML, "String beginning","String ending",ListBoxName)

Edit: Might have to update the Addons from Vb6 to .net
#5
Do you think its possible for you to update them chad?

if the setup convertor doesnt work?

Edit :
I got it

 Public Function ExtractAll(ByVal SearchString As String, ByVal StartString As String, ByVal EndString As String, ByVal AddToList As System.Windows.Forms.ListBox) As String

Dim temp2, Temp, temp1, temp3 As Integer
temp1 = 1

Do While InStr(temp1, SearchString, StartString, CompareMethod.Text) <> 0
Temp = InStr(temp1, SearchString, StartString, CompareMethod.Text) + Len(StartString)
temp2 = InStr(Temp, SearchString, EndString, CompareMethod.Text)
temp3 = temp2 - Temp
temp1 = temp2 + 1
AddToList.Items.Add((Mid(SearchString, Temp, temp3)))
Loop
End Function