I have a link of an OPENTEXT REST API : [https://developer.opentext.com/webaccess/#url=%2Fawd%2Fresources%2Fapis%2Fcs-rest-api-for-cs-16-s&tab=501] and I want to get the json file of this rest api so I used this link [https://developer.opentext.com/webaccess/#url=%2Fawd%2Fresources%2Fapis%2Fcs-rest-api-for-cs-16-s&tab=501/api-docs.json] and I tried to parse it using jsoup (since this is a web page) but it does not show me the requiered content because it's using an and it's not shown in the main HTML code! After many tries I figured out that the main URL for this json file is : [https://developer.opentext.com/awd/resources/apis/cs-rest-api-for-cs-16-s/api-docs.json] which is invoked to this web page using XHR (I figured it out using Google dev tools). Now my question is how to get the main URL of this json file using the first URL. and please do not give me this link [How to get XMLHTTPRequest response text of external web page using Java? because it responses not my needs
1 Answer
You can copy this request as Curl and then -> use Curl in Java. This is I think the simplest way but not the best one.
3 Comments
Elliott Frisch
URL includes a lot of personalized session identifiers. And the site has a ReST API. And this entire web scraping exercise is fraught with a single change on the third-party site breaking everything. A third-party site with a ReST API....
maryem neyli
@ElliottFrisch So I think it's impossible to get that file using java?
Elliott Frisch
It's possible. Show us your code. Tell us the base url. With what you have so far shown, I would have to write everything from scratch to provide you a solution. After spending a bit of time figuring out what you're trying to do. Which you still haven't said.
BufferedReader,URL, andHttpURLConnection