Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Login into secure web site and download data into worksheet?

I posted this question a couple months ago, and got a few responses, but
never got the code to work, so Im re-posting now (finally have some free
time to revisit this).

Id like to go to this site:
http://www.countrybobsdemo.com/administrator/

login with these credentials:
username = Ryan
password = ryan123

Id like to store these values in tow cells, such as Sheet2, A1 = Ryan and
Sheet2, B1 = ryan123.

Once I login, Id like to go to Components RSform!Pro Manage
Submissions, which you can click though and see, or see here (once logged in):
http://www.countrybobsdemo.com/admin...ag e&formId=2

So, all the data is there. Id like to download all of that, into a sheet,
maybe Sheet3!! How can it be done?

Thanks,
Ryan---

PS, I tried recording a macro, and it failed miserably!!!

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Login into secure web site and download data into worksheet?

there are 4 tables on your webpage. I down loaded the Login history table
onto a worksheet.

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(1)

RowCount = 1
For Each itm In History.Rows
Range("A" & RowCount) = itm.innertext
Next itm
End Sub




"ryguy7272" wrote:

I posted this question a couple months ago, and got a few responses, but
never got the code to work, so Im re-posting now (finally have some free
time to revisit this).

Id like to go to this site:
http://www.countrybobsdemo.com/administrator/

login with these credentials:
username = Ryan
password = ryan123

Id like to store these values in tow cells, such as Sheet2, A1 = Ryan and
Sheet2, B1 = ryan123.

Once I login, Id like to go to Components RSform!Pro Manage
Submissions, which you can click though and see, or see here (once logged in):
http://www.countrybobsdemo.com/admin...ag e&formId=2

So, all the data is there. Id like to download all of that, into a sheet,
maybe Sheet3!! How can it be done?

Thanks,
Ryan---

PS, I tried recording a macro, and it failed miserably!!!

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Login into secure web site and download data into worksheet?

I modified the code to get the page you requested. The original code was
getting a table from the homepage. the new code is getting the table you
requested. The table for some reason is repeating data twice in some cells
of the table. Yo need to clean up the reasults, but it give ALL the data in
the table.


Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Cells(RowCount, ColCount) = Col.innertext
ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

there are 4 tables on your webpage. I down loaded the Login history table
onto a worksheet.

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(1)

RowCount = 1
For Each itm In History.Rows
Range("A" & RowCount) = itm.innertext
Next itm
End Sub




"ryguy7272" wrote:

I posted this question a couple months ago, and got a few responses, but
never got the code to work, so Im re-posting now (finally have some free
time to revisit this).

Id like to go to this site:
http://www.countrybobsdemo.com/administrator/

login with these credentials:
username = Ryan
password = ryan123

Id like to store these values in tow cells, such as Sheet2, A1 = Ryan and
Sheet2, B1 = ryan123.

Once I login, Id like to go to Components RSform!Pro Manage
Submissions, which you can click though and see, or see here (once logged in):
http://www.countrybobsdemo.com/admin...ag e&formId=2

So, all the data is there. Id like to download all of that, into a sheet,
maybe Sheet3!! How can it be done?

Thanks,
Ryan---

PS, I tried recording a macro, and it failed miserably!!!

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Login into secure web site and download data into worksheet?

I made a small change to get rid of the duplicate data. This works very well

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Select Case Col.Children.Length

Case 0, 1, 2
Cells(RowCount, ColCount) = Col.innertext
Case Is = 3
Cells(RowCount, ColCount) = Col.Children(1).innertext
End Select

ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

I modified the code to get the page you requested. The original code was
getting a table from the homepage. the new code is getting the table you
requested. The table for some reason is repeating data twice in some cells
of the table. Yo need to clean up the reasults, but it give ALL the data in
the table.


Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Cells(RowCount, ColCount) = Col.innertext
ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

there are 4 tables on your webpage. I down loaded the Login history table
onto a worksheet.

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(1)

RowCount = 1
For Each itm In History.Rows
Range("A" & RowCount) = itm.innertext
Next itm
End Sub




"ryguy7272" wrote:

I posted this question a couple months ago, and got a few responses, but
never got the code to work, so Im re-posting now (finally have some free
time to revisit this).

Id like to go to this site:
http://www.countrybobsdemo.com/administrator/

login with these credentials:
username = Ryan
password = ryan123

Id like to store these values in tow cells, such as Sheet2, A1 = Ryan and
Sheet2, B1 = ryan123.

Once I login, Id like to go to Components RSform!Pro Manage
Submissions, which you can click though and see, or see here (once logged in):
http://www.countrybobsdemo.com/admin...ag e&formId=2

So, all the data is there. Id like to download all of that, into a sheet,
maybe Sheet3!! How can it be done?

Thanks,
Ryan---

PS, I tried recording a macro, and it failed miserably!!!

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Login into secure web site and download data into worksheet?

W-O-N-D-E-R-F-U-L-!-!-!
That's why you are gold-level, Joel!

Thanks so much!!
Ryan---



--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"joel" wrote:

I made a small change to get rid of the duplicate data. This works very well

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Select Case Col.Children.Length

Case 0, 1, 2
Cells(RowCount, ColCount) = Col.innertext
Case Is = 3
Cells(RowCount, ColCount) = Col.Children(1).innertext
End Select

ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

I modified the code to get the page you requested. The original code was
getting a table from the homepage. the new code is getting the table you
requested. The table for some reason is repeating data twice in some cells
of the table. Yo need to clean up the reasults, but it give ALL the data in
the table.


Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Cells(RowCount, ColCount) = Col.innertext
ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

there are 4 tables on your webpage. I down loaded the Login history table
onto a worksheet.

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(1)

RowCount = 1
For Each itm In History.Rows
Range("A" & RowCount) = itm.innertext
Next itm
End Sub




"ryguy7272" wrote:

I posted this question a couple months ago, and got a few responses, but
never got the code to work, so Im re-posting now (finally have some free
time to revisit this).

Id like to go to this site:
http://www.countrybobsdemo.com/administrator/

login with these credentials:
username = Ryan
password = ryan123

Id like to store these values in tow cells, such as Sheet2, A1 = Ryan and
Sheet2, B1 = ryan123.

Once I login, Id like to go to Components RSform!Pro Manage
Submissions, which you can click though and see, or see here (once logged in):
http://www.countrybobsdemo.com/admin...ag e&formId=2

So, all the data is there. Id like to download all of that, into a sheet,
maybe Sheet3!! How can it be done?

Thanks,
Ryan---

PS, I tried recording a macro, and it failed miserably!!!

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Login into secure web site and download data into worksheet?

Don't forget to change your password!
--
Steve

"ryguy7272" wrote in message
...
W-O-N-D-E-R-F-U-L-!-!-!
That's why you are gold-level, Joel!

Thanks so much!!
Ryan---



--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"joel" wrote:

I made a small change to get rid of the duplicate data. This works very
well

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Select Case Col.Children.Length

Case 0, 1, 2
Cells(RowCount, ColCount) = Col.innertext
Case Is = 3
Cells(RowCount, ColCount) = Col.Children(1).innertext
End Select

ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

I modified the code to get the page you requested. The original code
was
getting a table from the homepage. the new code is getting the table
you
requested. The table for some reason is repeating data twice in some
cells
of the table. Yo need to clean up the reasults, but it give ALL the
data in
the table.


Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

HomeURL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 HomeURL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

URL = "index.php?option=com_rsform&task=submissions.mana ge&formId=2"

'get web page
IE.Navigate2 HomeURL & URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(2)

RowCount = 1
For Each itm In History.Rows
ColCount = 1
For Each Col In itm.Cells
Cells(RowCount, ColCount) = Col.innertext
ColCount = ColCount + 1
Next Col

RowCount = RowCount + 1
Next itm
End Sub





"joel" wrote:

there are 4 tables on your webpage. I down loaded the Login history
table
onto a worksheet.

Sub Login()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://www.countrybobsdemo.com/administrator/"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getelementsbytagname("Form")

Set NameBox = IE.document.getElementById("modlgn_username")
'check if already login
If Not NameBox Is Nothing Then
NameBox.Value = "Ryan"

Set PasswordBox = IE.document.getElementById("modlgn_passwd")
PasswordBox.Value = "ryan123"

Form(0).submit
Do While IE.busy = True
DoEvents
Loop
End If

Set Mytables = IE.document.getelementsbytagname("table")

Set History = Mytables(1)

RowCount = 1
For Each itm In History.Rows
Range("A" & RowCount) = itm.innertext
Next itm
End Sub




"ryguy7272" wrote:

I posted this question a couple months ago, and got a few
responses, but
never got the code to work, so Im re-posting now (finally have
some free
time to revisit this).

Id like to go to this site:
http://www.countrybobsdemo.com/administrator/

login with these credentials:
username = Ryan
password = ryan123

Id like to store these values in tow cells, such as Sheet2, A1 =
Ryan and
Sheet2, B1 = ryan123.

Once I login, Id like to go to Components RSform!Pro Manage
Submissions, which you can click though and see, or see here (once
logged in):
http://www.countrybobsdemo.com/admin...ag e&formId=2

So, all the data is there. Id like to download all of that, into
a sheet,
maybe Sheet3!! How can it be done?

Thanks,
Ryan---

PS, I tried recording a macro, and it failed miserably!!!

--
Ryan---
If this information was helpful, please indicate this by clicking
''Yes''.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Script to download from secure site Greg@food family Excel Programming 13 June 11th 07 01:57 PM
Import from a secure site botha Excel Discussion (Misc queries) 1 June 20th 06 07:16 PM
Download a CSV file from an internet site Microchip Excel Programming 0 March 28th 06 12:41 PM
a little more secure login Gixxer_J_97[_2_] Excel Programming 2 July 7th 05 03:27 PM
How to web query a login required site abuhatim Excel Programming 3 December 5th 03 01:40 PM


All times are GMT +1. The time now is 03:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"