IE 6.0, SP2
Open Investment web site, no id and password requeired.
But Need to select some items for download Fact Sheet.
How to using VBS to open the web site upto step 5 and then download
the PDF as below steps ?
Step 1. Open Main Screen
http://www.alliancebernstein.com/investments/ABII/GatewayPage.aspx
Step 2. Select "Asia/Pacific" -> Hongkong -> English
Step 3
Click "I Accept"
Step 4
Cick "Continue"
Step 5 - Input for AllianceBernstein - Global Growth Trends
Portfolio
http://www.alliancebernstein.com/investments/ABII/FundDetail.aspx?nid=7850&fndNumber=9924
Step 6 Select Fact Sheets on right hand side link
Fund Fact Sheet
Step 7. Will Open New window for display PDF
Step 8. Save the PDF
Step 9. Close current screen
Step 10. close all Opened windows
That is a lot to ask of people who volunteer there time. I played
with it and it's a lot of work. Plus, I provided you with an example
a couple of days ago that does a lot of what you are asking for.
Instead of saying you need to do this 10 step process, try coding it
and ask for help with specific problems. Otherwise, I suspect you
will wait a long time for help.
_____________________
Tom Lavedas
Hi All
Actually, I want to try, But I does not know how to select the
hyperlink and set box and click the button.
And how to know the variable name in web page ?
Remember this from a couple of days ago?
sURL1 = "https://www.google.com/accounts/ServiceLogin?service=finance"
sURL2 = "http://www.google.com/finance/portfolio?action=view&pid=4"
sFilename = "D:\Someplace\somename.html"
with CreateObject("InternetExplorer.Application")
.Navigate sURL1
Do until .ReadyState = 4 : WScript.Sleep 100 : Loop
.visible = true
With .document.all
.email.value = "you...@yourdomain.com"
.passwd.value= "yourpassword" ' or Inputbox to ask the password
.signin.click
End With ' document
.Navigate sURL2
Do until .ReadyState = 4 : WScript.Sleep 100 : Loop
end with 'IE
Change the first URL to the page yo uare after in steps 1 & 2, that
is ...
Note that it is reached by adding "country=0285&lang=EN-HK" after the
question mark. I found that out by observing the full address in the
Address Bar once the browser showed the page.
Then review the actual source for that page by right-clicking in the
window and selecting View Source. Search for the string 'checkbox'
and you should find the name of the element that you want to check.
Then issue the appropriate instruction. That is replace the two
statements after the" with .document.all" line with the following ...
With .document.all
.ucAccountHolderCheckBox.click
.ucContinueImageButton_AggImageButton.click
end with
I got the second name from looking a little further on in the source
to see what the element that represented the Continue button was
called.
That should get you to the next page, from which it will be possible
to navigate to the next page ...
http://www.alliancebernstein.com/investments/ABII/FundDetail.aspx?nid=7850&fndNumber=9924
Then that source of page needs to be parsed to find the proper URL for
the document you want, something like this ...
sText = .document.body.innerHTML
nPos = Instr(sText, "cid=") + 4
nCid = Mid(sText, nPos,5)
sUrlpdf = "http://www.alliancebernstein.com/investments/ABII/" _
& "DisplayFile.aspx?cid=" & nCID & "&listType=Fact
Sheet&download=true"
That should get you to the page.
See if you can get that far.
______________________
Tom Lavedas
I suggest you get hold of Fiddler from Microsoft. You can then record the
steps needed to retrieve your file and examine them to see exactly what URLs
and data need to be sent to the server.
--
Joe Fawcett
http://joe.fawcett.name
Please inform your clients, audience, 'dejavu' readers if necessary.
Thank You.
"Tom Lavedas" <tglb...@cox.net> wrote in message
news:3e065e0d-e3e9-41ea...@p23g2000vbl.googlegroups.com...
On Nov 6, 4:25 am, moonhk <moon...@gmail.com> wrote:
> > Tom Lavedas- 嚙踝蕭嚙衛被嚙豬用歹蕭r -
>
> > - 嚙踝蕭亶Q嚙豬用歹蕭r -