Google calculator results are not displayed when using the API. Therefore, if you want them, you will have to clear the page. Be careful as it relates to Googleβs terms of service, so your IP address will be blocked if you send too many frequent requests.
Once you have the results page, use the html parser. The result is in the <b> (for example, <b>1 + 1 = 2</b> , if it is absent, then you do not have the result of the calculator). Be careful with the <sup> tags as a result (e.g. <b>(1 (m^2) kg) / 2 = 0.5 m<sup>2</sup> kg</b> ). You can also decode html objects.
source share