Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:42:12+00:00 2026-05-24T06:42:12+00:00

I am tring to get text from a website; when you change the language

  • 0

I am tring to get text from a website; when you change the language the html url have an “/en” inside, but the page that have the information that i want don’t have.

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>

The problem is that the website is in german and i want the text in english, and my script gets only the german version

Any ideas how can i do it?

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>");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:42:13+00:00Added an answer on May 24, 2026 at 6:42 am

    That site is internationalized with German as default. You need to tell the server what language you’re accepting by specifying the desired ISO 639-1 language code in the Accept-Language request header.

    URLConnection connection = new URL(url).openConnection();
    connection.setRequestProperty("Accept-Language", "en");
    InputStream input = connection.getInputStream();
    // ...
    

    Unrelated to the concrete problem, may I suggest you to have a look at Jsoup as a HTML parser? It’s much more convenient with its jQuery-like CSS selector syntax and therefore much less bloated than your attempt as far:

    String url = "http://www.wippro.at/module/gallery/index.php?limitstart=0&picno=0&gallery_key=92";
    Document document = Jsoup.connect(url).header("Accept-Language", "en").get();
    String title = document.select("#redx_gallery_pic_title").text();
    System.out.println(title); // Beech, glazing V3
    

    That’s all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to get Color information that i've stored in a text file and
I'm trying to make some text bold using HTML, but I'm struggling to get
When i try to read single line of text from website i get error
I am trying to get text input from the keyboard in Java 6. I
I'm trying to get the plain text from a word document. Specifically, the xpath
I am trying to get form parameters from a GET request. The html code
I created a swf that I have on my website. The swf loads xml
I am trying to get the API from a website called zillow working for
I am trying to screen scrape values from a website. # get the raw
Say I have an HTML form like this to collect an email from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.