简体   繁体   English

Java-如何使用Google Finance Currency Converter API?

[英]java - How to use google finance currency converter api?

i wanna know how to use "Google finance Converter" in android. 我想知道如何在Android中使用“ Google Finance Converter”。 Here is the url = https://www.google.com/finance/converter?a=1&from=USD&to=EGP&meta=ei%3DoBtUWanyG4rDU-6ygbAK i can write the amount, from, to. 这是url = https://www.google.com/finance/converter?a=1&from=USD&to=EGP&meta=ei%3DoBtUWanyG4rDU-6ygbAK,我可以写出从到的金额。 but i can't get the result because it's html, So how to get it? 但我无法获得结果,因为它是html,那么如何获得它呢?

Thanks 谢谢

This may not be real useful but you can get result 这可能不是真正有用,但您可以获得结果

First thing, you need country code from google finance. 首先,您需要Google金融提供的国家/地区代码。

Then web request to url using: 然后使用以下网址请求网址:

https://www.google.com/finance/converter?a=1&from=AED&to=ZWL

Here AED is from country code and ZWL is to country code. 这里的AED是国家代码,而ZWL是国家代码。

Then you can parse the html to get: 然后,您可以解析html以获得:

<div id=currency_converter_result>1 AED = <span class=bld>87.7634 ZWL</span>
<input type=submit value="Convert">
</div>

I don't know java but sure there will be elegant web request and html parser. 我不知道Java,但可以肯定会有优雅的Web请求和HTML解析器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM