ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] How to scrape this website dynamic data from Javascript with VBA?

[µo°Ý] How to scrape this website dynamic data from Javascript with VBA?

Website: https://www.hangseng.com/en-hk/personal/insurance-mpf/e-mpf/fund-price-performance/

Targets of automate data scraping: fund price as highlighted in the below figure



Tools: VBA(Excel), Chrome driven by Selenium

The code started as below:
  1. Chrome.ExecuteScript "window.open('https://www.hangseng.com/en-hk/e-services/e-mpf/fund-price- performance/price/','_blank');"

  2. Chrome.SwitchToNextWindow

  3. Chrome.FindElementByXPath("//a[text()='Acknowledge']").Click
½Æ»s¥N½X
Then I have no further idea to retrieve those specified data. Please provide help. Thanks a lot!

¦^´_ 2# singo1232001


  The code is very simple , but very productive!
There are also two questions:
1)
  1. Set A_s = chrome.FindElementsBytag("a")
  2.     For i = 1100 To A_s.Count
½Æ»s¥N½X
Only 139 "<a" tag can be searched in the website source code, what is the meaning of 1100 here?

2)  for another website http://www.aastocks.com/tc/stocks/quote/detailchart.aspx?symbol=110000
It is possible to extract the highlighted RSI data ?


Thank you very much!

TOP

Thanks a lot! I found if  I  switch to this OCR site https://ocr.space/
The code should works well.
Respect for your nice work!

¦^´_ 6# singo1232001

TOP

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD