Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 April 28th, 2006, 02:33 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB6 HTML Help

I am new to HTML parsing with VB6. I am using a Webbrowser control to access a web page. I have used the following code to get the NAME field.

text1.text = WebBrowser1.Document.getElementsByTagName("input") .Item(j).Name

I am trying to extract the DOE,JOHN from the following HTML line:

</TD><TD CLASS="bckGray">&nbsp;</TD><TD CLASS="bckGray">DOE, JOHN</TD><TD CLASS="bckGray">DOEJ</TD><TD CLASS="bckGray" align="CENTER">08&nbsp;-&nbsp;2006<INPUT VALUE="0" NAME="isCorrection464319" TYPE="HIDDEN">

All help would be greatly appreciated for this first time poster.
Thanks,
bwhit

 
Old May 13th, 2006, 03:04 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't have any solid code to post for you, but I ran into a similar problem when I was trying to extract text records from their HTML output. Basically, what I ended up doing was the following:
Read things in lines.
In each line, look for the first ">"
This is the first place that you're likely to find data, if you read the next character. If the space between > and the next < is only 1, then you know that you're dealing with tags that run together. </TD><TD CLASS="bckGray"> for example.

What I did was go through and check to see where there were spaces greater than 1 between the close and opening of tags. <B>Here is text</B>. In your case, it looks like you're going to need to add a little extra checking to take out all of the nbsp garbage. I hope this idea makes sense, feel free to e-mail me.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove orphaned html elements from html string pauliehaha C# 2008 aka C# 3.0 2 June 30th, 2008 09:40 AM
Launching HTML Help in VB6 tknnguyen Pro VB 6 1 October 16th, 2007 02:28 PM
html:errors and html:messages sparun1607 Struts 0 November 23rd, 2006 08:34 AM
Converting an HTML Server Control to HTML Control gratisaccount ASP.NET 1.0 and 1.1 Basics 2 August 7th, 2006 12:29 AM
Can you preload child html files to 1parent html? bekim Javascript How-To 4 January 22nd, 2005 04:17 PM





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