Quote:
Originally Posted by Fou-Lu
Assuming you've properly read it and you have a valid structure for the html, and the JS doesn't exist, the only thing I can think of is that an IFrame is in use.
If it terminates at the point of the div, I'd say you haven't completed the read.
|
This is the source code for one of the pages:
Code:
<html>
<head>
<title>sustainable development</title>
<link rel="Stylesheet" href="../../../activityshared/code/glossary.css">
</head>
<body class=defBody>
<span class=defTerm>sustainable development</span>
<span class=defText>
The long-term prosperity of human societies and the ecosystems that support them
</span>
</body>
</html>
All pages are identical, save for text content
This is the code that is read:
Code:
<head>
<title>sustainable development</title>
<link rel="Stylesheet" href="../../../activityshared/code/glossary.css">
</head>
<body class=defBody>
<span class=defTerm>sustainable development</span>
<span class=defText>
</span>
</body>
Notice, the missing HTML tags and the defText tag being empty.
This is the code for the reader:
Code:
public void get(URL u) throws IOException{
URLConnection con = u.openConnection();
con.connect();
BufferedReader c = new BufferedReader(new InputStreamReader(con.getInputStream()));
System.out.println(u);
String s = "";
while(c.readLine() != null){
s += c.readLine() + "\n";
}
System.out.println(s);
c.close();
}
Lastly, allow me to apologize for failing to include this in the original post.
Edit: I am unfamiliar with web sockets; I was skipping a line, as does not happen with a Scanner (which uses
InputStream.hasNext()), and on a hunch I replaced the reader code with this:
Code:
String s = "";
String sub;
while((sub = c.readLine()) != null){
s += sub + "\n";
}
and all works perfectly.