473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

extract text from html

I've got some text with a few HTML tags, such as the following
<Bold>Hello</Bold>There buddy<p>please .....

I need to be able to extract just the text, which would be
Hello there buddy please....

Note, this is a Windows App, and not a Web App.
Any ideas anyone?
Dec 12 '05 #1
4 3999
Patrick,

You can have a look if this sample fits you

http://www.vb-tips.com/default.aspx?...f-56dbb63fdf1c

I hope this helps,

Cor
Dec 12 '05 #2
"Patrick" <pr***@pnews.uik> schrieb:
I've got some text with a few HTML tags, such as the following
<Bold>Hello</Bold>There buddy<p>please .....


<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>

+

MSHTML
(<URL:http://groups.google.de/group/microsoft.public.de.german.entwickler.dotnet.cshar p/msg/a83d872faebd1134>)

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 12 '05 #3
Patrick ,

if you mean your Goal is just simply removing the HTML tags from a string

i made a function for this purpose with some Regex

Private Function stripHTML(ByVal strHTML) As String

Dim objRegExp As New System.Text.RegularExpressions.Regex("<(.|\n)+?>")

Return objRegExp.Replace(strHTML, "")

End Function

i use this in a winforms app that stripes websites for valuable information
with a webclient

hth

Michel Posseth [MCP]
"Patrick" <pr***@pnews.uik> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've got some text with a few HTML tags, such as the following
<Bold>Hello</Bold>There buddy<p>please .....

I need to be able to extract just the text, which would be
Hello there buddy please....

Note, this is a Windows App, and not a Web App.
Any ideas anyone?

Dec 14 '05 #4
Excellent solutions.
Thanx.

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:Oj*************@tk2msftngp13.phx.gbl...
Patrick ,

if you mean your Goal is just simply removing the HTML tags from a string

i made a function for this purpose with some Regex

Private Function stripHTML(ByVal strHTML) As String

Dim objRegExp As New System.Text.RegularExpressions.Regex("<(.|\n)+?>")

Return objRegExp.Replace(strHTML, "")

End Function

i use this in a winforms app that stripes websites for valuable
information with a webclient

hth

Michel Posseth [MCP]
"Patrick" <pr***@pnews.uik> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've got some text with a few HTML tags, such as the following
<Bold>Hello</Bold>There buddy<p>please .....

I need to be able to extract just the text, which would be
Hello there buddy please....

Note, this is a Windows App, and not a Web App.
Any ideas anyone?


Dec 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Guogang | last post by:
Hi, I need to extract plain text from HTML page (i.e. do not show images, html formatting, ...) Is there some C# class/function that can help me on this? Thanks, Guogang
1
by: Ori | last post by:
Hi, I have a HTML text which I need to parse in order to extract data from it. My html contain a table contains few rows and two columns. I want to extract the data from the 2nd column in...
9
by: trihanhcie | last post by:
Hi, I would like to extract the text in an HTML file For the moment, I'm trying to get all text between <tdand </td>. I used a regular expression because i don't know the "format between...
9
by: gregmcmullinjr | last post by:
Hello, I am new to the concept of XSL and am looking for some assistance. Take the following XML document: <binder> <author>Greg</author> <notes> <time>11:45</time>
0
by: manuel.reil | last post by:
Hello, currently i am developing a very small cms using python and cheetah. very early i have noticed that i was lacking the method to extract/recover the contents (html,text) from the html that...
1
by: steveyjg | last post by:
I want to extract the following data from a retrieved html file and store the information as strings. 'get the text of "title" <h1 id="test_title">title</h1> 'get the contents of the value...
1
by: nkg1234567 | last post by:
I'm trying to extract HTML from a website in the form of a string, and then I want to extract particular elements from the string using the substr function: here is some sample code that I have thus...
9
by: flit | last post by:
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: "...
1
by: Alberto Sartori | last post by:
Hello, I have a html text with custom tags which looks like html comment, such: "text text text <p>text</ptext test test text text text <p>text</ptext test test <!-- @MyTag@ -->extract...
18
by: Ecka | last post by:
Hi everyone, I'm trying to write a PHP script that connects to a bank's currency convertor page using cURL and that part works fine. The issue is that I end up with a page that includes a lot...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.