473,654 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Download HTML As Plain Text

good day,

I was just wondering how can I download a web page as plain text from a
certain web site. I have tried to use the OpenURL() method from INET control
in my VB.NET app, but it returns elements such as this <BR> within the plain
text. Is there a way to filter them or to simply download the page as plain
text?

any help would be greatly appreciated.
Nov 20 '05 #1
8 3051
"Doominato" <Bi******@hotma il.com> wrote in
news:bg******** ***********@new s01.bloor.is.ne t.cable.rogers. com:
I was just wondering how can I download a web page as plain text from a
certain web site. I have tried to use the OpenURL() method from INET
control in my VB.NET app, but it returns elements such as this <BR>
within the plain text. Is there a way to filter them or to simply
download the page as plain text?


No. Web pages are not plain text, they are HTML. If you download it it, it
will always come in the format that it is, being HTML.

To have it as plain text you will need to convert it.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
Nov 20 '05 #2
thanks for reply,

I realize that but I should have said that it is an HTML format but it
contains plain text (btw, this is the type of the page that i'm talking
about
http://www.wunderground.com/history/...html?format=1).
If you look at it and it's source you will see that they are pretty much
look the same except that source contains these tags sunch as <BR>, so the
question is how do I remove these tags and convert it to plain text???

thanks
Nov 20 '05 #3
That seems really stupid of weather underground not to actually provide a comma delimited file!but that junk. I'd be finding out if I couldn't find someone in their computer department to create real csv files (I don't know who's idea it was to do it like that)

Meanwhile, If you can get the entire document into a string, you can use a Replace(wholeDo c, "<BR>", vbCrLf), and then output that to a real csv file.

Also you've probalby noticed that there are no line breaks separating the actual data, which makes replacing those <br> with CRLF even more critical!

Good Luck!
--Michael

"Doominato" <Bi******@hotma il.com> wrote in message news:8O******** ***********@new s04.bloor.is.ne t.cable.rogers. com...
thanks for reply,

I realize that but I should have said that it is an HTML format but it
contains plain text (btw, this is the type of the page that i'm talking
about
http://www.wunderground.com/history/...html?format=1).
If you look at it and it's source you will see that they are pretty much
look the same except that source contains these tags sunch as <BR>, so the
question is how do I remove these tags and convert it to plain text???

thanks

Nov 20 '05 #4
Hello,

I got an upper-hand on this and was able to clear out all the tags, so now I
got a clean CSV file.

Thank you so much for your help.

Nov 20 '05 #5
Hi Doominato

In addition to the others

In an HTML page you have always the property InnerText and OuterText.

The Innertext is between the tags, the Outertext including the tags.

HTML.outertext is almost forever a complete document including all tags and
whatever, however without the strange enough now more and more preceding
declaration line of a HTML page which is as far as I know unreachable using
the Document Object Model.

I hope this helps?

Cor
Nov 20 '05 #6
* "Doominato" <Bi******@hotma il.com> scripsit:
I was just wondering how can I download a web page as plain text from a
certain web site. I have tried to use the OpenURL() method from INET control
in my VB.NET app, but it returns elements such as this <BR> within the plain
text. Is there a way to filter them or to simply download the page as plain
text?


Nice algorithm, implemented in VB6:

<URL:http://groups.google.c om/groups?selm=ebX m3efoCHA.1976%4 0TK2MSFTNGP10>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #7
Hi Herfried,

Have a time a look at mshtml, this is very amateuristique in my opinion.

http://msdn.microsoft.com/library/de...LDHTMLAPIs.asp

Cor
Nov 20 '05 #8
* "Cor Ligthert" <no**********@p lanet.nl> scripsit:
Have a time a look at mshtml, this is very amateuristique in my opinion.


I know that it's possible with MSHTML, but Olaf's algorithm is in VB6
/very/ fast and often it's good enough. I am not sure if it will work
with the "shorttag" option and stuff like that enabled.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #9

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

Similar topics

3
1856
by: timbratureman | last post by:
I have a txt file in my server. I have to provide to the user 2 links. One link is to download the file and the other one is to display it inside the browser. Is it possible? I made <a href="file.txt">Download the file</a> but it display it, and it does not ask me to download it. (of course I could download it by clicking the right button, but my boss doesn't want that: he wants 2 different links).
2
2001
by: Tom Youngquist | last post by:
I am trying to download a text file that my .NET page has just created based on entered parameters on the web page. Everything seems to work and the file is created. I am using the following code to start the download process: Response.Clear() Response.ContentType = "text/plain" Response.AppendHeader("Content-Disposition", "attachment; filename=" & fileName) Response.AppendHeader("Content-Description", "This is your Cost Journal...
5
3363
by: Thomas Andersson | last post by:
Hi, I am trying to find a working solution for download of large files (400-800 MB)... But this seems almost impossible to find a working example. I have tried Response.Transmitfile, this works for some people…but in my case the server reset the connection after approx. 20 minutes and sometimes after 7-8 minutes…the download speed is however very good 400MB takes about 10
0
1321
by: Showjumper | last post by:
I set up a download tracker. When i first tested it, all was fine. However as i just found out via an email, the zip file is corrupt. Folks can download the file but it just cant be opened. The download code appears to work fine as far as logging the user and sending the file (as far as i can tell) but my guess is that there is a problem with the download tracker that is corrupt ing the file because the file is fine onmy local drive. Any...
0
1736
by: Rhys666 | last post by:
Basically I have a link that opens my download page and the querystring identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring, identifies the template required then uses Response.AppendHeader to amend the response to create the file download dialogue. On my local machine this works fine and the download dialogue correctly identifies the file name and type attempting to be...
5
5273
by: Baren | last post by:
Hi! I am using impersonate="true" to upload and download files from a network share. I have created common users on both the webserver and the file server. The user has permission to the files server folder. I am able to upload the files into the fileserver, but while downloading the same i am getting error "file doesn't exist" and the path it shows is localhost temporary internet files.
3
1634
by: Nathan Sokalski | last post by:
I have a webform that contains a button which I want to do three things: 1. Delete a record from a database 2. Let the user download a text file that is generated 3. Refresh the page to show that the record was deleted I am able to do any of these things separately with no trouble. The problem occurs when I try to offer a download AND call my refresh method. When I try to do a download and call my refresh method, only the download is...
10
3472
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox Response Headers - http://www.hixie.ch/advocacy/xhtml Date: Wed, 23 Nov 2005 21:36:06 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e Vary: Accept-Encoding,User-agent
17
1790
by: V S Rawat | last post by:
I joined this ng and tried to post my first message that had a small php code (HTML and all). my newsserver aioe.net rejected the post saying "HTML Tags". My message was in text format, not in html format, but it obviously had html tags. Now, a php or a perl/ cgi or a javascript ng is always going to had html tags in posted messages. What is the point in not allowing Html tags?
0
8376
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8594
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7307
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1596
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.