Results 1 to 12 of 12

Thread: Get page source WITH user info?

  1. #1

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Get page source WITH user info?

    I've found something that is a problem in .Net that wasn't in VB6, for once.

    I'm trying to get some user info (pertaining to the username that a person inserts into a textbox) from a page source of a web-community website. For example, if the user types in "John Doe" and clicks the button, it downloads their, let's say TheDilly.com "User Home Page" source for parsing. Only problem is, when I download the source (i.e. "http://www.thedilly.com/usernamehere"), it downloads the source as if said person were logged out (i.e. the "guest" page), even if they manually go log into the site before downloading the source.

    So in other words, regardless of if the user is logged into the site or not, it will download the guest display page source. It won't recognize that they're actually logged in.

    Rather than have to insert a webbrowser control and do it that way, I'd like to avoid that if at all possible. If that's the only way, then fine. But if not, I'd really like some insight as to how to do it using something like (what I'm using now) My.Computer.Netword.DownloadFile()

    Any ideas?
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  2. #2

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    Ha, never even mind about the web browser control. Even if I log into the site using Firefox, and then try to display the home page in the web browser control in my app, it still acts as if I'm not logged in. I'd have to code it to click the "login" link, wait for the page to load, have it enter the username & password, click "submit" or "login" or whatever, wait for it to log in, and THEN download the source.

    Any way around that?
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  3. #3

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    Bump.

    Nobody knows this? I'm surprised!
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  4. #4
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    343

    Re: Get page source WITH user info?

    What is the extension? .PHP, most likely but it would help to know.

  5. #5

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    it's a shortname for a .php, yes. But even just on the home page, or ANY page for that matter (even those with .htm or .html), it doesn't show them as being logged in. I have to log in using the web browser control in the project, and THEN do My.Computer.Network.DownloadFile() for it to display the html for someone who is logged in.
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  6. #6

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    So, NOBODY has any clue about this? If not, I'll just mark it as resolved and check elsewhere.
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Get page source WITH user info?

    I can't answer your question but one point to note is that logging into a site with FireFox isn't going to affect the WebBrowser control in any way. That control uses the IE engine so shares its cookie store with IE. If you log into a site with IE then open it in a WebBrowser control, then it should show you as logged in.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    Quote Originally Posted by jmcilhinney
    I can't answer your question but one point to note is that logging into a site with FireFox isn't going to affect the WebBrowser control in any way. That control uses the IE engine so shares its cookie store with IE. If you log into a site with IE then open it in a WebBrowser control, then it should show you as logged in.
    Nope, it does not. I have to log in using the browser control itself. Weird, huh?
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Get page source WITH user info?

    Quote Originally Posted by BrendanDavis
    Nope, it does not. I have to log in using the browser control itself.
    Truly?
    Quote Originally Posted by BrendanDavis
    Weird, huh?
    Truly.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    Yeah, that's what I don't get either. I thought about logging in with IE first and then trying it, but it still came up as "Hi, Guest!" on the home page in the browser control of my app, in addition to grabbing the guest-page html via My.Computer.Network.DownloadFile() :sad:
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

  11. #11
    Addicted Member cha0s4u's Avatar
    Join Date
    Apr 2005
    Location
    new Delhi - 1ND1A
    Posts
    209

    Re: Get page source WITH user info?

    After logging into the site from a IE browser window, get a handle for that window. Once u have handle for the concerned window, I normally use IHTMLDocument2 (com object from MSHTMLCtl) to get the source of the logged in page. you can even parse the links or anything on the page that the IE is showing...

    HTH
    -NJOI
    - cha0s4u ENJOI

    Do Remember to RATE a post if it helps u,
    Ratings encrougage those who Know enough,to help others

  12. #12

    Thread Starter
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: Get page source WITH user info?

    Quote Originally Posted by cha0s4u
    After logging into the site from a IE browser window, get a handle for that window. Once u have handle for the concerned window, I normally use IHTMLDocument2 (com object from MSHTMLCtl) to get the source of the logged in page. you can even parse the links or anything on the page that the IE is showing...

    HTH
    -NJOI
    That's not quite what I'm looking for. I already know how to get the source. But I want to do so without having an open browser window. This mini-application is going to be sort of a mini-utility for the website, and therefore I don't want to have to have the user physically log into the website just to use this utility. I'm just trying to get it to be able to parse info like guestbook page XML, forum topic lists, etc.
    God put me on this earth to do many great things, and I'm so far behind that I'm going to live forever.

    I'm programming for Windows using a Apple Mac Mini, 1.5Ghz with 512MB DDR RAM. I feel like I'm committing a crime :P

Posting Permissions

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



Click Here to Expand Forum to Full Width