I had been querying stock/financial data from Yahoo (non US) but it has recently upgraded its pages for that country to javascript and so now each page no longer has its own URL. I had been using simple VBA code to automatically get this data. Now I can only get the first page. When I hover over the link for the next page of data, the status bar says "javascript:goPage('002'). Is there a way to program the code to go to the next page?
I went to the source code of the page and I found the following snippet of code:
<form name='form_cont' method='post' action="st06.html">
<input type=hidden name="contgb" value="0">
<input type=hidden name="code" value="005930">
<input type=hidden name="gubun" value="4">
<input type=hidden name="page" value="2">
</form>
Is there a way using VBA to change the hidden value of the page?
Thanks,
Richard
Sub GetStockPrices()
URL = "URL;" & " & TickerSymbol
With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("a1")) 'write web-page to sheet
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.BackgroundQuery = True
.AdjustColumnWidth = False
.WebFormatting = xlWebFormattingNone
.WebTables = "7,8,13,14"
.refresh BackgroundQuery:=False
End With
End Sub
I went to the source code of the page and I found the following snippet of code:
<form name='form_cont' method='post' action="st06.html">
<input type=hidden name="contgb" value="0">
<input type=hidden name="code" value="005930">
<input type=hidden name="gubun" value="4">
<input type=hidden name="page" value="2">
</form>
Is there a way using VBA to change the hidden value of the page?
Thanks,
Richard
Sub GetStockPrices()
URL = "URL;" & " & TickerSymbol
With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("a1")) 'write web-page to sheet
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.BackgroundQuery = True
.AdjustColumnWidth = False
.WebFormatting = xlWebFormattingNone
.WebTables = "7,8,13,14"
.refresh BackgroundQuery:=False
End With
End Sub