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.
Results 1 to 5 of 5
Thread: [Req] Extract Multiple link
- 28 Feb. 2010 03:30pm #1
[Req] Extract Multiple link
- 28 Feb. 2010 04:03pm #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
Code:if (substr($link, 7) != "http://") { $link = $baseurl.$link; }
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])}
- 28 Feb. 2010 04:15pm #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
- 28 Feb. 2010 05:39pm #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
- 01 Mar. 2010 12:14am #5
Do you think its possible for you to update them chad?
if the setup convertor doesnt work?
Edit :
I got it
PHP Code: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
Last edited by Bman; 01 Mar. 2010 at 12:29am.