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?
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?
Re: Get page source WITH user info?
Bump.
Nobody knows this? I'm surprised!
Re: Get page source WITH user info?
What is the extension? .PHP, most likely but it would help to know.
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.
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.
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.
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?
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.
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:
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
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.