我正在使用以下课程:
public class GetHtmlContent {
public static String GetHtml(){
String content = null;
HttpURLConnection connection = null;
try {
connection = (HttpURLConnection) new URL("https://www.hrkgame.com/en/randomkeyshop/set_currency/?cur=EUR&next=/en/").openConnection();
connection.setUseCaches(false);
Scanner scanner = new Scanner(connection.getInputStream());
scanner.useDelimiter("\\Z");
content = scanner.next();
scanner.close();
}catch ( IOException e) {
System.out.println("IOException caught! \n" + e);
}finally {
connection.disconnect();
}
return content;
}
但是,即使艰难地将货币设置为EUR,我几乎每次都会获得随机货币。
我从页面顶部的菜单中获得了链接。
我什至尝试了以下网址: https://www.hrkgame.com/en/randomkeyshop/set_currency?cur=EUR
非常感谢您的协助。