简体   繁体   中英

How to get specific information from a website using JAVA HTTP request

I want to write a program in java to make http request and print for me only the information I Want. For example there's this website: "https://br.investing.com/currencies/usd-brl" And here I need to get only the information about the dolar value in real time. How do I do that in java? I thought it would be more easy using an API but I have no idea on how to do it.

I have no idea where to start or resources i should be using, I need to use only native java resources no third party modules.

there isn't API at 'investing.com' but simple widget. you should crawl the data OR using API via another site.

i think the Exchange rate information is provided by not only investing.com but also several finance service. And you can using Class URL, HttpUrlConnection in java.net to request for data to target url you need.

https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java.net/URL.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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