Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Login to Web Page and the Search Page for Text

Hi, i'm new to this so pls bear with me if i seem a little dumb :-)

i have a intranet page were i need to login, (achived this woo-hoo)
after the login i need to search the page for a string of text, if the
text is there then i need to end the sub else if the string is not
there i need to download a file and save it to a disk.
the log in process involves me having to post data to move to the next
screen, 1st page asks for user name and pwd, 2nd page i need to confim
i am authorised to use the site by clicking yes button and final login
page requests me to continue to the main page, then i select a link to
the reports page and heres were i'm stuck, i need to search this page
to check if the reports are complete if not then do nothing else
download 2 reports, this also means i need to wait for internet
explorer to finish the 1st download before starting the next (have no
clue how to do this) any help would be greatly appreciated. thanks and
kind regards

heres the code so far.

Sub A_LoginToBBPlatform()
Dim ie As Object

Dim sURL As String
Dim tURL As String
Dim rURL As String
Dim uURL As String
Dim vHeader As String
Dim bytPostData() As Byte
Dim bytPostData1() As Byte
Dim bytPostData2() As Byte
Dim rsUsername As String
Dim rsPassword As String

rsUsername = "801753228"
rsPassword = "714829"

Set ie = CreateObject("InternetExplorer.Application")

sURL = "http://someurl/pincheck.cfm"
tURL = "http://someurl/setusercookies.cfm"
rURL = "http://someurl/mainmenu.cfm"
uURL = "http://someurl/reports.cfm?RequestTimeout=120"

bytPostData = "EIN=1234&PIN=1234"
bytPostData1 = "AAN=1234&EIN=1234&PIN=1234"
bytPostData2 = ""

bytPostData = StrConv(bytPostData, vbFromUnicode)
bytPostData1 = StrConv(bytPostData1, vbFromUnicode)
bytPostData2 = StrConv(bytPostData1, vbFromUnicode)
sHeader = "Content-Type: " & "application/x-www-form-urlencoded " &
vbCrLf

With ie
.Navigate sURL, 0, " self", bytPostData, sHeader
Do While ie.Busy Or ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
.Navigate tURL, 0, " self", bytPostData1, sHeader
Do While ie.Busy Or ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
.Navigate rURL, 0, " self", bytPostData2, sHeader
Do While ie.Busy Or ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
.Navigate uURL, 0, " self"
Do While ie.Busy Or ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
End With

Set ie = Nothing
End Sub

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
Want to dump text written on page 1 to page 2 in excel Moni Excel Worksheet Functions 3 November 2nd 07 07:01 PM
Putting Page Number in last page text DRK Excel Programming 4 December 3rd 05 08:32 AM
Login to a web page & automatically fill in pasword Dave F.[_4_] Excel Programming 2 June 27th 05 12:33 PM
excel fit to 1 page shows 1 page but not all data is on that page Jans Excel Programming 1 September 2nd 04 01:49 AM
trying to search 4 text in a word doc & print page? rede96 Excel Programming 1 April 2nd 04 03:01 PM


All times are GMT +1. The time now is 06:08 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"