Downloading Web Page HTML Example
This code demonstrates how to download the HTML source code from a specified web page and output it to the screen. Can be used to retrieve tags, or words, or peanut butter from web pages. Enjoy.
AI
Resumen de IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Código fuente
import java.net.*;
import java.io.*;
public class URL1
{
public static void main(String[] args) throws Exception {
URL url = new URL("http://www.coryvia.net");
InputStream html = url.openStream();
int c = 0;
String a = "";
while(c != -1) {
a = "";
c = html.read();
if(c == (char)60) {
while(c != (char)62) {
a = a + (char)c;
c = html.read();
}
}
if(a == "") {}
else
System.out.println(a + ">");
}
}
}
Comentarios originales (3)
Recuperado de Wayback Machine