返回列表 上一主題 發帖

[發問] 網路資料下載問題,

[發問] 網路資料下載問題,

本帖最後由 GBKEE 於 2014-11-21 17:14 編輯

GBKEE大大,之前有看您幫助解決在公開資訊觀測站抓資料的文

我需要抓取公司的財務資料(網址如下)

http://mops.twse.com.tw/mops/web/t164sb04

透過GBKEE大大的指導,我可以用VBA Excel抓到非金融公司的資料(程式碼如下)

        Dim Ie, Doc As Object, i, j As Long

        Set Ie = CreateObject("InternetExplorer.Application")
   
        With Ie
   
        Ie.Navigate "http://mops.twse.com.tw/mops/web/t164sb04"
   
        Ie.Visible = True
   
           Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop

        .Document.getelementbyID("isnew").Value = "true"    '最新資料 = true, 歷史資料 = false
        .Document.getelementbyID("co_id").Value = "2888"    '股票代號
        .Document.getelementbyID("year").Value = Year        '年度
        .Document.getelementbyID("season").Value = Quarter   '第一季 = 01, 第二季 = 02, 第三季 = 03, 第四季 = 04
        
        For i = 0 To .Document.getElementsByTagName("input").Length - 1
            
            If .Document.getElementsByTagName("input")(i).Type = "button" And .Document.getElementsByTagName("input")(i).Value = " 搜尋 " Then
               
                .Document.getElementsByTagName("input")(i).Click
            
            End If
        
        Next


但碰到要下載金融公司的財報就卡住了,我不管怎試,就是進不到第2層(如下畫面)

上面的程式碼不會直接跑出財報,只會列出金融公司相關公司資訊。必須再次點選"詳細資料"才能叫出財報資料

[attach]19616[/attach]




不知道GBKEE大大能否幫忙看一下

感恩

還是沒辦法。就會卡在這一頁。進不去財務資訊業面


公司代號

公司名稱


2880 華南金  
28800001 華南銀行  
28800002 華南永昌  
28800004 華南保  
28800005 華南投信   
28800006 華南金創   
28800007 華南金管   
28800008 華南金資   
28800009 華銀保代   
28800010 華南投顧   
28800012 華永香港   
28800013 華永資管

TOP

        靜思自在 : 待人退一步,愛人寬一寸,就會活得很快樂。
返回列表 上一主題