Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 6th, 2008, 02:36 AM
Registered User
 
Join Date: Feb 2008
Location: Chandler, Arizona, USA.
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>
tag.

Here is the code for the portion im talking about:

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

            Dim intIndex As Integer
            Dim intLastIndex As Integer
            Dim strInfo As String 
            strInfo = ""
            intIndex = strData.IndexOf("<div class=""description""",
0)
            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)
                Else
                    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
 code.
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!

-Boniggy

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.