+ Reply to Thread
Results 1 to 7 of 7

Different response text depending on login or logout state

  1. #1
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Different response text depending on login or logout state

    Hello friends,

    With my code (given below), I capture source of my website's webpage and then I am trying to find a string with InStr and process it with Split. Everything is working but I have an issue where I need help.

    When I am logged in to my website supplying the username and password, I can see the string in the webpage source but when I am in a logged out state, my string is not visible in the webpage source. What changes do I need in the code which will tell the computer that I am logged in.

    Appreciate a reply. Thanks

    Please Login or Register  to view this content.
    EDIT
    Is this a cache issue? if yes, how to code it so that it honors the browser cache and gets the source as it shows up in logged in state?
    Last edited by sabha; 10-08-2015 at 02:53 PM.

  2. #2
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Different response text depending on login or logout state

    bump!

    Here is how the cookie is captured
    MemberId=333333&MemberStatusId=20&MemberStatus=Null&MemberEmail=myemail@gmail.com&Password=av8pfLNOpHQqb7XsqPVrwm==&LastLoginIP=100.10.100.100&LastLoginDate=10/8/2015 11:58:00 AM&CreationDate=10/6/2015 10:23:00 AM&SecondLastLoginDate=10/8/2015 11:58:00 AM&MP_MemberProfileId=333333&MP_MemberProfileStatusId=20&MP_MemberProfileStatus=Null&MP_DisplayName=MyDP V&MP_FirstName=MyFirstname&MP_LastName=MyLastname

    I hope I have conveyed what exactly I am looking at. However, wish to give an example. You may not see the string "My Account" in the webpage source if the user is NOT logged in but it will be visible if the user is logged in. I want to capture some text shown under MyAccount which otherwise you will not be able to see if the user is NOT logged in.

    Thanks

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Different response text depending on login or logout state

    Well if you're not logged in, you need to log in? - That code doesn't log you in anywhere?

  4. #4
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Different response text depending on login or logout state

    I was logged to the website in three browers, IE/FF/Chrome but still it does not work. and I dont know what changes to make in the code so that it reads the cookie information before executing the oHttp.send command or how to login to the website programmatically with WinHttpRiequest

    sURL = "http://www.google.com" is just a sample. my actual website is different.

  5. #5
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Different response text depending on login or logout state

    Now I discovered the actual reason.
    webpageSource = oHttp.ResponseText is not giving me complete web page source. It is incomplete. It strips out first 1223 lines and outputs only from line 1224 till the end.

    Any ideas how to correct this?

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Different response text depending on login or logout state

    You can't log in with the browser, it doesn't work like that. You need to log in with WinHTTP, additionally responseText returns everything, you're probably debug.printing it which does cut it off

  7. #7
    Forum Contributor
    Join Date
    11-29-2014
    Location
    India
    MS-Off Ver
    MS Excel 2007
    Posts
    240

    Re: Different response text depending on login or logout state

    Is there any other method (instead of debug.print)? just to check if the variable captures full html? may be output it to some text file? appreciate if you could give me the syntax by editing my code.
    Also if what you said is correct then how can i login with WinHTTP?
    Thanks

    EDIT
    This is to confirm that what you said was correct. it shows full html if the contents is passed on to a txt document. So now the question is how can I login with WinHTTP or how can I manually pass a cookie that will tell the code that the user is logged in?
    Last edited by sabha; 10-09-2015 at 12:57 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Login and Logout Template
    By carlzilla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2020, 10:55 AM
  2. Login - Logout report
    By vamshi57 in forum Excel General
    Replies: 9
    Last Post: 04-19-2016, 12:38 AM
  3. Replies: 0
    Last Post: 02-17-2014, 07:44 AM
  4. login and logout time , with total login time ,break> 1 hours
    By shrinivasmj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2013, 05:37 AM
  5. [SOLVED] Duration: login logout macro
    By city in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-11-2012, 11:25 AM
  6. Login Logout Report
    By excelnightmare in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2011, 01:45 PM
  7. Login Logout userform
    By poitachi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2010, 03:01 PM
  8. First login & last Logout
    By Vikky in forum Excel General
    Replies: 2
    Last Post: 08-19-2006, 01:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1