웹 사이트에서 텍스트를 가져오고 싶습니다. 언어를 변경하면 html url에 "/ en"이 있지만 원하는 정보가있는 페이지에는 없습니다.Java - 구문 분석 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>");
어떤 프로그래밍 언어를 사용하고 있습니까? HTML을 구문 분석하기 위해 사용하는 언어 API는 무엇입니까? 지금까지 HTML 컨텐트를 가져 오는 코드를 보여줍니다. – BalusC
프로그래밍 언어 : Java –
답변을 올렸지 만, 장래에 정말로 언급하고 태그해야합니다. 사이트에서 HTML을 파싱하는 방법이 너무 많아서 그것에 대해 아무 말도하지 않았습니다. – BalusC