|
-
Feb 6th, 2007, 08:13 PM
#1
Thread Starter
Hyperactive Member
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
-
Feb 6th, 2007, 08:19 PM
#2
Thread Starter
Hyperactive Member
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
-
Feb 7th, 2007, 08:07 PM
#3
Thread Starter
Hyperactive Member
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
-
Feb 7th, 2007, 10:43 PM
#4
Hyperactive Member
Re: Get page source WITH user info?
What is the extension? .PHP, most likely but it would help to know.
-
Feb 8th, 2007, 03:54 AM
#5
Thread Starter
Hyperactive Member
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
-
Feb 9th, 2007, 02:58 PM
#6
Thread Starter
Hyperactive Member
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
-
Feb 9th, 2007, 11:46 PM
#7
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.
-
Feb 9th, 2007, 11:56 PM
#8
Thread Starter
Hyperactive Member
Re: Get page source WITH user info?
 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
-
Feb 10th, 2007, 12:02 AM
#9
Re: Get page source WITH user info?
 Originally Posted by BrendanDavis
Nope, it does not. I have to log in using the browser control itself.
Truly?
 Originally Posted by BrendanDavis
Weird, huh?
Truly.
-
Feb 10th, 2007, 01:09 AM
#10
Thread Starter
Hyperactive Member
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
-
Feb 10th, 2007, 01:39 AM
#11
Addicted Member
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 
-
Feb 10th, 2007, 12:37 PM
#12
Thread Starter
Hyperactive Member
Re: Get page source WITH user info?
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|