我特林得到来自网站的文本;当你改变语言时,html网址里面有一个“/ en”,但是包含我想要的信息的页面没有。爪哇 - 解析HTML - 获取文本
http://www.wippro.at/module/gallery/index.php?limitstart=0&picno=0&gallery_key=92
html tags: (the text contains the description of the photo)
<div id="redx_gallery_pic_title"> text text </div>
的问题是,该网站是在德国,我想在英语的文字,我的脚本只获得了德语版
任何想法我怎么能做到这一点?
java code:
...
URL oracle = new URL(x);
BufferedReader in = new BufferedReader(new InputStreamReader(oracle.openStream()));
String inputLine=null;
StringBuffer theText = new StringBuffer();
while ((inputLine = in.readLine()) != null)
theText.append(inputLine+"\n");
String html = theText.toString();
in.close();
String[] name = StringUtils.substringsBetween(html, "redx_gallery_pic_title\">", "</div>");
你使用什么编程语言?你用什么语言API来解析HTML?显示您到目前为止获取HTML内容的代码。 – BalusC
编程语言:Java –
我发布了一个答案,但是在将来,您应该真的提及并标记它。有一种巨大的方法来解析网站的HTML,你甚至都没有告诉它任何关于它的事情。 – BalusC