Sign in to follow this  
Followers 0
Noddle

Help, Getting Money Rate from a site

3 posts in this topic

#1 ·  Posted (edited)

Hi

I'm wanting to get the rate of the exchange from this site,   ( aus / php )

http://blog.orbitremit.com/a-currency-exchange-rate-calculator-that-will-save-you-money/             ( Calculator )

or

http://blog.orbitremit.com       ( today's exchange rate )

but to see the 'rate' you click the button (Calculator / Top right)

I think it's java or something else,

HTML / Java are not my strong point,

I wonder if someone who's bored can have a look and whip me up some code to get the values,

I can phrase it or what ever on the returned data,  but I have no idea how to get the data to start with,

thanks for any help,  or even pointers

I played with _IEBodyReadHTML  &  _IEDocReadHTML  but it does not brig back anything I'm after

Nigel

Edited by Noddle

Share this post


Link to post
Share on other sites



just un test 

 

#include <IE.au3>

Local $Txt_to_send = 999

Local $oIE = _IECreate("http://blog.orbitremit.com/a-currency-exchange-rate-calculator-that-will-save-you-money/")
_IELoadWait($oIE)

Local $oDiv = _IEGetObjById($oIE, "calculator-btn")
_IEAction($oDiv, "click")
_IELoadWait($oIE)
Sleep(1000)
Local $oDiv = _IEGetObjById($oIE, "send-input")

_IEAction($oDiv, "focus")
_IEAction($oDiv, "selectall")

Send($Txt_to_send)

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

That's does work, 

but is there a way to do it all by code, so there is no ''clicking' as such

as in,  query the site via  code, and get the site to give 'up' the exchange rate it's offering ?

or execute the java code somehow to get the returned values of the rate(s)

after a lot more playing with this site,  I found another link that gave me what I want,

#include <IE.au3>

Local $oIE =  _IECreate("www.orbitremit.com/philippines?source=AUD",0,0)
Local $sText = _IEBodyReadHTML ($oIE)

$StartPos = StringInStr($sText,'<p class="data"><span class="flag flag-databox flag-ph"></span>')
$tempString=Stringmid($sText,$StartPos + 63,13)
; ConsoleWrite($tempString & @CRLF)

$EndPos = StringInStr($tempString,'</p>') -1
$DailyRate=StringLeft($tempString,$EndPos)
ConsoleWrite("Rate is " & $DailyRate & @CRLF)
_IEQuit($oIE)

I'm sure there is much more elegant way to get the rate out of the return data, but this works

Nigel

Edited by Noddle

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0