1

How can I parse HTML data like I were in other country?

I've tried to use proxy (code):

System.setProperty("http.proxyHost", "some proxy");
System.setProperty("http.proxyPort", "some port");

but it doesn't work properly. I still get data in my country language.

I've also tried using VPN, but when I do my program (Jsoup parser) doesn't download anything.

EDIT:

Thanks for your time, the marked answer helped me to solve the problem. The complete solution I found there .

Community
  • 1
  • 1
Gniewomir
  • 109
  • 11

1 Answers1

0

That depends on the site you're trying to download. If the site is using IP geolocation, the only solution is to use appropiate proxy: https://stackoverflow.com/a/1433296/1608594

If the site is only using HTTP headers to determine language, you can send Accept-Language, Accept-Charset and Accept-Encoding headers with the proper values. https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields

Community
  • 1
  • 1
carbolymer
  • 1,439
  • 1
  • 15
  • 30