Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 6th, 2008, 02:36 AM
Registered User
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to boniggy Send a message via MSN to boniggy
Default Trying to pull data between two different HTML tag

Ok so im a complete n00b at using vb.NET as i have been used to using
vb6 for a little over a year. I'm sort of forcing myself to
learn .NET.

Anyways im working on a project that parses a webpage of its data. The
data I need to pull is between the tags of <div class="description">
and </ul>. If i could pull this data it would be great. The only
problem i have is that my program currently starts at the first
"description" tag and then parses everything else in to the bottom of
the page. I cant seem to figure out why it wont stop at the last </ul>

Here is the code for the portion im talking about:

            'get the response from the server
            responseReader = New IO.StreamReader(webRequest.GetResponse.GetResponseStream)
            responseData = responseReader.ReadToEnd
            strData = responseData

            Dim intIndex As Integer
            Dim intLastIndex As Integer
            Dim strInfo As String 
            strInfo = ""
            intIndex = strData.IndexOf("<div class=""description""",
            intLastIndex = intIndex

            While intIndex >= 0

                intIndex = strData.IndexOf("</ul>", intIndex)

                If intIndex >= 0 Then
                    strInfo += strData.Substring(intLastIndex,
intIndex - intLastIndex) + "</ul>"
                    intLastIndex = intIndex
                    intIndex = strData.IndexOf("<div
class=""description""", intLastIndex + 1)
                    intIndex = -1
                End If
            End While
I then take the data that gets parsed and put it into a txt or html
file. Personally i think it might be ReadToEnd at the top of the
If i've left anything out that you need please let me know. Like
i said im still learning programming so if its too cryptic I may
answer back with an explanation.

Any help would be GREATLY appreciated and thank in advance!


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pull excel data into oracle tables yogeshyl Oracle 1 January 9th, 2008 12:38 PM
HTML tag from C# or ASP.NET tag from javascript angshujit ASP.NET 2.0 Basics 3 February 16th, 2007 10:07 AM
wscript pull data only by current date putermikey Classic ASP Professional 1 October 31st, 2006 06:49 AM
HTML tag vs Body Tag CFGerry BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 October 7th, 2005 07:13 AM
Can't pull data from ntext field into recordset. rstelma SQL Server 2000 2 August 26th, 2003 04:50 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.