1

I tried this

private static String readUrl(String urlString) throws Exception {
BufferedReader reader = null;
try {
    URL url = new URL(urlString);
    reader = new BufferedReader(new InputStreamReader(url.openStream()));
    StringBuffer buffer = new StringBuffer();
    int read;
    char[] chars = new char[1024];
    while ((read = reader.read(chars)) != -1)
        buffer.append(chars, 0, read); 

    return buffer.toString();
} finally {
    if (reader != null)
        reader.close();
}
}

But it returned

<script>
document.cookie = 'BXID=AAAAAAUo78YKTFtc33JkgZ25mtq287qQum8hFjskkvwbnF0MBw==; path=/; domain=biletix.com';
location.reload(true);
</script><noscript>Couldnot find javascript support. please enable it</noscript>

I want to get objects from http://www.biletix.com/search/TURKIYE/en#!subcat_interval:12/12/15TO19/12/15

http://www.biletix.com/solr/en/select/?start=0&rows=100&fq=end%3A[2015-12-12T00%3A00%3A00Z%20TO%202015-12-19T00%3A00%3A00Z%2B1DAY]&sort=vote%20desc,start%20asc&&wt=json

From here, i can get what i want but is it only way to create this URL and how to create this?

I am using this in Eclipse but i will migrate to Android.

I can not find examples about creating this url.

http://stackoverflow.com/questions/7467568/parsing-json-from-url
http://stackoverflow.com/questions/10500775/parse-json-from-httpurlconnection-object
http://en.proft.me/2013/12/5/how-parse-json-java/

But those dont work because i cant parse String

1 Answers1

0

The text that you got is a script that instructs browser

  1. set cookie BXID to AAAAAAUo78YKTFtc33JkgZ25mtq287qQum8hFjskkvwbnF0MBw.
  2. reload the page.

So you need to add this cookie to your next request by adding cookie header. It should looks like:

Cookie: BXID=AAAAAAUo78YKTFtc33JkgZ25mtq287qQum8hFjskkvwbnF0MBw==
MrGregorix
  • 11
  • 1