Jump to content
Sign in to follow this  
taylansan

reading currency rate from bank website with _INetGetSource

Recommended Posts

taylansan

Hello Autoit Forum,

The following is the to HSBC Turkey branch: http://www.hsbc.com.tr/tr/yatirim/doviz_altin/

When i enter this site, the page displays the USD buying (2.1594) / selling (2.1666) rates.

post-23255-0-67431200-1409295214.jpg

I am not so familiar with IE functions and tried to use:

$pageSource = _INetGetSource('http://www.hsbc.com.tr/tr/yatirim/doviz_altin')

But unfortunately, I couldn't find the rates for buying / selling. I'm not sure, maybe it's because of FlashPlayer or something else.

Is there any other way to get the rate values other than _INetGetSource function? Or how can i use _INetGetSource function for better results?

Thanks in advance for your answers.


TY.

Share this post


Link to post
Share on other sites
mikell

The data you want are in a frame, so you must get the frame link first

The frame content has a lot of text so the Inet is a bit long, be patient  :)

#Include <Array.au3>
$txt = BinaryToString(InetRead("http://www.hsbc.com.tr/tr/yatirim/doviz_altin/", 1))

$link = StringRegExpReplace($txt, '(?s).+frame\h*src="([^"]+).+', "$1")
msgbox(0,"frame link", $link)

$txt = BinaryToString(InetRead($link))
msgbox(0,"", "loaded")

; $res = StringRegExp($txt, '(?s)tableEx1:0:text1(?:5|6).+?>([^<]+)', 3)
$res = StringRegExp($txt, '(?s)(?:indirectParitform:tableEx1:text5|tableEx1:0:text1(?:5|6)).+?>([^<]+)', 3)
 _ArrayDisplay($res)

To get it faster you might use an other site

Edited by mikell
  • Like 1

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  

×