nijawang wrote:
請問這種先要選幾個選項,才會出現資料的網頁該如何抓資料?
類似1313樓範例的寫法




排版、代碼,請自行練習修改
[點擊下載]
nijawang wrote:
請問這種先要選幾個選項,才會出現資料的網頁該如何抓資料?
howard383873 wrote:
可以參考哪一樓的寫法?
Sub test()
MsgBox DateToUnixTime("2025/01/27")
MsgBox DateToUnixTime1(Now())
MsgBox UNIXTime()
End Sub
Function DateToUnixTime(dstring As String) As Long
DateToUnixTime = (DateValue(dstring) - #1/1/1970 8:00:00 AM#) * 86400
End Function
Function DateToUnixTime1(dstring As Date) As Long
DateToUnixTime1 = (dstring - #1/1/1970 8:00:00 AM#) * 86400
End Function
Function UNIXTime()
UNIXTime = Round(((Date - #1/1/1970#) * 86400 + Timer) * 1000, 0)
End Function
snare wrote:
突然發現goodinfo...(恕刪)
Morten Hsu wrote:
這都是帶html標籤的連續字串
Morten Hsu wrote:
爬文看到 613樓有抓GoodInfo的股利政策,但是對我而言,實在太高段了。嘗試執行getpost71(new2)卻發生如
Sub all_table()
Dim chrome As New Selenium.ChromeDriver, UrL As String, table, R As Integer, C As Integer, i As Integer, TempArray
Sheets("工作表1").Cells.Clear
R = 1: C = 1
UrL = "https://goodinfo.tw/tw/StockDividendPolicyList.asp?MARKET_CAT=全部&INDUSTRY_CAT=全部&YEAR=2025"
chrome.Get UrL
chrome.Wait 6000
Set table = chrome.FindElementsByTag("table")
For i = 1 To table.Count
R = R + 1
TempArray = table(i).AsTable.Data
Sheets("工作表1").Cells(R, C).Value = "****** Table " & i & "******"
If (UBound(TempArray) * UBound(TempArray, 2)) > 0 Then
Sheets("工作表1").Cells(R + 1, C).Resize(UBound(TempArray), UBound(TempArray, 2)).Value = TempArray
End If
R = R + UBound(TempArray) + 1
DoEvents
Next i
chrome.Quit
Set chrome = Nothing
End Sub
Sub one_table()
Dim chrome As New Selenium.ChromeDriver, UrL As String, stock As String, table, TempArray
Sheets("工作表1").Cells.Clear
UrL = "https://goodinfo.tw/tw/StockDividendPolicyList.asp?MARKET_CAT=全部&INDUSTRY_CAT=全部&YEAR=2025"
chrome.Get UrL
chrome.Wait 6000
Set table = chrome.FindElementsByTag("table")
TempArray = table(9).AsTable.Data 'table(n)
Sheets("工作表1").Cells(1, 1).Resize(UBound(TempArray), UBound(TempArray, 2)).Value = TempArray
chrome.Quit
Set chrome = Nothing
End Sub
activer wrote:
本次資料似乎會存在於"function getExchangeOne()"中