0

Not able to extract data from a website using JSoup

here is the link of that website:- https://in.tradingview.com/symbols/AUDNZD/?exchange=FX after opening this you'll see a forex chart in which you'll see OANDA and its value. i want that value of OANDA. i tried many things but i wasn't able to get the data.

2nd Jul 2020, 3:41 AM
Manjit Kumar
Manjit Kumar - avatar
5 Réponses
0
Looks like the website is loading in data with javascript. Jsoup is just an html parser and wont be able to get any data created by js. I'd recommend looking into capturing it via an automated browser such as selenium.
2nd Jul 2020, 8:13 AM
JME
0
JME how selenium will be able to capture that... I checked network tab.. couldn't find anything.
2nd Jul 2020, 8:16 AM
Manjit Kumar
Manjit Kumar - avatar
0
Navigate to page with selenium. Pause wait for js to load value. Use selenium find element to select the element containing the value. The get attribute innerhtml to get the actual value and the do whatever you want with it.
2nd Jul 2020, 8:23 AM
JME
0
https://www.selenium.dev/documentation/en/ Should be able to figure it out with this. I've seen other people use something called htmlunit to accomplish similar things but never tried myself.
2nd Jul 2020, 8:26 AM
JME
0
Okayy... I'll try.
2nd Jul 2020, 8:27 AM
Manjit Kumar
Manjit Kumar - avatar