Question

How to read dynamic webpage using HTTPCaller?

  • 27 September 2017
  • 2 replies
  • 9 views

Hi,

I am using HTTPCaller to read the content of this webpage https://ir.euroinvestor.com/Solutions/Shell/2088/miniquote2.aspx and try to retrieve the price but seem that HTTPCaller cannot retrieve it. It only able to retrieve  

<div class="price"> </div>

and no price. Anyone know how to get the value if the webpage is dynamic?

Thank you.


2 replies

Badge +10

It's not a Table, so you can't use the HTML Table Reader and also just trying to read the page as Text and the fishing out the correct rows also appears not to give a result as there is lots of JavaScript behind the scenes, presumably fetching the latest prices. The HTTPCaller just fetches back the underlying scripts so I think you're likely going to need to spend some money to get the information you need back from an API or web service. Euroinvestor appear to have one but it looks like it might be in Danish. Its with this kind of service that you'd have more success with the HTTPCaller, though you'd likely be charged on a per request basis.

Perhaps someone else has some thoughts that are more optimistic?

Badge +3

As @1spatialdave mentioned there might be some javascript processing in the background.

There are python libraries that make it possible to get the browser rendered HTML. Sample code is here:

https://stackoverflow.com/questions/8960288/get-page-generated-with-javascript-in-python

You need to install a separate python, install selenium library (eg: pip) and change Python Interpreter in Tools/FME Options/Translation

Reply