Silent_Warrior5
New Member
- Joined
- Aug 11, 2018
- Messages
- 4
hi all,
i want to load some table data from a java script website.
i use excel query connection and open the excel browser (think it is a old IE) and answer some scripts error message with "no, do not continue the script" and then the website loading and i close the excel browser and the macro works.
But today nothing work. This Error message appears:
Note: Since your browser does not support JavaScript, you must press the Resume button once to proceed.
ok it just load if i open the query and click error message and close the browser.
Ok i think the website need cookies or a token ( i find some line in the website text) . Where can i see what the website needs to login and work fine?
I test this marco but error was "forbidden"
what code works that the macro login with token? or cookie or something and loading the table data?
Thx and cheers
Silent_Warrior5
i want to load some table data from a java script website.
i use excel query connection and open the excel browser (think it is a old IE) and answer some scripts error message with "no, do not continue the script" and then the website loading and i close the excel browser and the macro works.
But today nothing work. This Error message appears:
Note: Since your browser does not support JavaScript, you must press the Resume button once to proceed.
ok it just load if i open the query and click error message and close the browser.
Ok i think the website need cookies or a token ( i find some line in the website text) . Where can i see what the website needs to login and work fine?
I test this marco but error was "forbidden"
Code:
Sub Dow_HistoricalData()
Dim xmlHttp As Object
Dim TR_col As Object, TR As Object
Dim TD_col As Object, TD As Object
Dim row As Long, col As Long
Set xmlHttp = CreateObject("MSXML2.XMLHTTP.6.0")
xmlHttp.Open "GET", "https://musterfirma.coupahost.com/receipts?cond%5B1%5D%5Bcol_key%5D=order_header_id&cond%5B1%5D%5Border_heade r_id%5D=1372229&cond%5B1%5D%5Border_header_id_op%5D=eq&search_mode=advanced", False
xmlHttp.setRequestHeader "Content-Type", "text/xml"
xmlHttp.Send
Dim html As Object
Set html = CreateObject("htmlfile")
html.body.innerHTML = xmlHttp.responseText
Dim tbl As Object
Set tbl = html.getElementById("curr_table")
row = 1
col = 1
Set TR_col = html.getelementsbytagname("TR")
For Each TR In TR_col
Set TD_col = TR.getelementsbytagname("TD")
For Each TD In TD_col
Cells(row, col) = TD.innerText
col = col + 1
Next
col = 1
row = row + 1
Next
End Sub
Thx and cheers
Silent_Warrior5
Last edited by a moderator: