新しいGooglePlayマーケットからページをダウンロードしようとしていますが、奇妙な結果が得られているようです。私はURLhttps://play.google.com/store/apps/details?id=package.name
と次の方法を使用します:
private static String downloadString(final URL url) throws IOException {
final HttpsURLConnection conn = (HttpsURLConnection) url
.openConnection();
conn.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(final String hostname,
final SSLSession session) {
return true;
}
});
conn.setReadTimeout(10000);
String html;
try {
final InputStream is = conn.getInputStream();
final BufferedInputStream bis = new BufferedInputStream(is);
final ByteArrayBuffer baf = new ByteArrayBuffer(50);
int current = 0;
while ((current = bis.read()) != -1) {
baf.append((byte) current);
}
/* Convert the Bytes read to a String. */
html = new String(baf.toByteArray());
} finally {
conn.disconnect();
}
return html;
}
結果には、説明、変更ログ、または重要なものは含まれていませんが、私のhtmlの知識は、ダウンロードされているものを正確に理解するのに十分ではありません。ダウンロードしたソースコードを興味のある方のためにここに載せておきます。これは、GooglePlayアプリのページである目的のページの10分の1です。
私の質問は、元のアプリページのソースを取得するにはどうすればよいですか?