anyone have an example of parsing a string such as an an img link from webpage or a certain string from the webpage...?
not good in .net help
aim: popper
greetings, fellow internet!anyone have an example of parsing a string such as an an img link from webpage or a certain string from the webpage...?
not good in .net help
aim: popper
Regex
Coder for hire. Anything you need, outstanding prices and good return time.
Contact: Skype - GetMoneyHo, AIM - theorangebox
i dont know much about .net but id imagine the mid and left functions still work.
getmoney!
someone burn me vb.net2008 then mail me it ill pay for shipping and discs no lie. i cant find it working for me anywhere.
getmoney!
i have full academic copy of VS 2005 isos that i could put somewhere.
also if you are wanting to parse html files i suggest using some sort of XML parser. the only problem is i highly doubt many pages of the internet are valid xml documents.
Last edited by RPC; 03-04-2009 at 11:15 AM.
VSE Portfolio: Click hereOMG My boobs are too big for this menu
* pad changes topic to 'lesbians make me sick'(10:29:35 PM) dropc0de: but thats only because she'll treat his dick like a tub of chocolate ice cream
sry for dbl post.
http://vbcity.com/page.asp?f=howto&p=strings_strtok
tokenize a string.
<img src="...." height="" width="" alt="">
if you tokenize by just the " " standard space, you would get
array[] = "<img", "src="...."", ..etc;
ofc you could then tokenize those items more if you wanted the data in the src tag for instance. you would loop over all tokens and find the one that has a sub string of src.
then take that token and tokenize it against "=". the 2nd token would have the src data,
Maybe thats what your looking for?
VSE Portfolio: Click hereOMG My boobs are too big for this menu
* pad changes topic to 'lesbians make me sick'(10:29:35 PM) dropc0de: but thats only because she'll treat his dick like a tub of chocolate ice cream
Definitely use regex for this.
VSE Portfolio: Click hereOMG My boobs are too big for this menu
* pad changes topic to 'lesbians make me sick'(10:29:35 PM) dropc0de: but thats only because she'll treat his dick like a tub of chocolate ice cream
Dim someshit As Match = Regex.Match(htmlCode, "<img src=""(.*?)"">", RegexOptions.IgnoreCase)
someshit.groups(1).tostring() will be the url of the image.
Ok, I will look into regex.
Thanks to Zain and Audio for the help!
Here is the parse code in VBNet to get between two pieces of text..
Public Function Parses(ByVal sdata As String, ByVal delim1 As String, ByVal delim2 As String) As String
Return sdata.Substring(sdata.IndexOf(delim1) + delim1.Length, sdata.IndexOf(delim2) - (sdata.IndexOf(delim1) + delim1.Length))
sdata.Substring(sdata.IndexOf(delim1) + delim1.Length, (sdata.Length - sdata.IndexOf(delim2)))
End Function
Example
Dim TitlePage As String
TitlePage = Parses(htmlData, "<title>", "</title>")
would grab between <title> and </title>
Thanks again guys.
Bookmarks