Jsoup处理br

		try {
			Document doc = Jsoup.connect("http://book.sina.cn/prog/wapsite/books/h5/vipc.php?bid=232872&cid=343466&cp=1&sort=asc&PHPSESSID=bd8c678e4c42e771dbaa3ac125aaf009&vt=4").get();
			String temp = doc.html().replace("<br />", "$$$$$");
			doc = Jsoup.parse(temp);
			
			Element top_m = doc.select("div.top_m").first();
			if( top_m != null )
			{
				System.out.println( top_m.text() );
			}
			Element zw = doc.select("div#zw").first();
			
			if( zw != null )
			{
				String sZW = zw.text().replace("$$$$$", "\n");
				System.out.println(sZW);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

从这里学来的:

http://stackoverflow.com/questions/13479645/how-to-parse-new-line-from-html-using-jsoup

你可能感兴趣的:(Jsoup处理br)