|
-
Nov 21st, 2012, 02:55 PM
#1
Thread Starter
New Member
Click on javascript:__doPostBack link in VB6
Here is the page URL that has a link in it I am trying to click on:
http://guggenheiminvestments.com/pro.../wfvk/holdings
I open this page in WebBrowser1.
The link within this page is:
javascript:__doPostBack('p$lt$zoneMainContent$pageplaceholder$pageplaceholder$lt$zoneCenter$ETFHoldi ngsWidget$Export','')
Here is the code I am using in VB6 that I am trying to use to click on the link (does not work):
WebBrowser1.Document.parentWindow.execScript "javascript:__doPostBack('p$lt$zoneMainContent$pageplaceholder$pageplaceholder$lt$zoneCenter$ETF Hold ingsWidget$Export','')"
I then need to save the page.
Help is appreciated. Thank you.
-
Nov 27th, 2012, 08:12 AM
#2
Hyperactive Member
Re: Click on javascript:__doPostBack link in VB6
The _doPostBack function takes two parameters. First, the event target and second event arguments. You don't have to worry about event arguments in your example. Essentially, what the postback function does is take the first parameter (the target) and fires that event. Normally a developer would have a hidden form (like a button) and name it something unique. That Id would be used in the doPostback to fire the event associated with the hidden button to fire an event on the server side. What appears to be happening if that when you click on the "Export" link, the server is instructed to create the Excel sheet. Because it is being created on the server, I do not see a way in which you can call that function from an outside source.
But, it appears you want to programatically download an Excel sheet that lists companies and their associated ticker ID, trading price, etc? If so, create your own! Yahoo has a very easy API that you can use. All you do is pass a few parameters in the address and you get an Excell sheet. For more info, check out: http://code.google.com/p/yahoo-finan...hooFinanceAPIs
if i was able to help, rate my post!
-
Oct 9th, 2018, 02:59 PM
#3
Thread Starter
New Member
Re: Click on javascript:__doPostBack link in VB6
Is there an update to jasonwucinski reply? Yahoo no longer supports http://code.google.com/p/yahoo-finan...hooFinanceAPIs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|