Hello,
The following is unfortunately incomplete as I can't seem to find the
appropriate command to click the submit image, or submit the form/page. Hope
someone will help on that.
---------------------------------------------------
Sub download_csv()
Dim IE As New InternetExplorer, web_item, a, x
IE.Visible = True
IE.Navigate "https://www.services.nymex.com/otcsettlement/OTCSettle.jsp"
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'Agrees with the Disclaimer form
If IE.LocationURL Like "*disclaimer*" Then
'Selects 'I agree'
IE.Document.Links(4).Click
'submits the form
!!!!!! PROBLEM HERE !!!!!!
End If
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'clicks on "Download all available..."
IE.Document.all.Item("ctl00_btnExport").Click
End Sub
---------------------------------------------------
"(E-Mail Removed)" wrote:
> I am looking for a way to automate downloading natural gas market data
> that is available here:
>
> https://www.services.nymex.com/otcse.../OTCSettle.jsp
>
> The Usage agreement must be agreed to and then the link "Download all
> available OTC settlement data" must be clicked prompting a CSV
> download. I then need to copy this all into an excel sheet and can
> take it from there.
>
> Note: the link that prompts the download doesn't have a URL but is
> "javascript:__doPostBack('ctl00$btnExport','')"
>
> Is there a way to do this with web query?
>
> Help is much appreciated. Thanks.
>