Forums Register Login

Read an html file and print the contents to console

+Pie Number of slices to send: Send
hi,

i have an html file. i want to read the contents of this html file and print it to standard output.

i am new to java IO and streams. Please help me with some code snippets.

I am usng Oracle JDeveloper as the IDE.
+Pie Number of slices to send: Send
Hi,

Do you want to read the HTML document from the file system, or via http off a web-server?

If option 1, try something like:



if option 2, take a look first at java.net.HttpURLConnection and the getInputStream() method it inherits
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6243 times.
Similar Threads
Reading HTML using JAVA
servlets
Include servlet to read and print a file in html
Problem reading in all contents of a webpage using url.openstream()
Writing to a file on the server whose URL is given
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:07:11.