Hello
Say there is a webpage, on a website which uses some kind of sessions to keep people logged in.
The page has a lot of stuff on it, and I wish to get only certain things.
Now, correct me if I'm wrong, but couldn't i use PHP socks to connect to this website and then grab the output and put it into a var? From where on, the extraction of information would be as easy as doing various string researches.
The thing I'm not sure on, is how sessions would be handled. This website uses a simple user/pass login, and written in ASP. Sessions don't seem to last long, though I'd say it uses cookies, because it makes like 9 of them.
So yes, if someone could perhaps give me the possibilities of how this can be done - that is initiating or taking advantage of an active session using PHP.
Thanks.
Using PHP to extract text from a web page?
Moderator: General Moderators
-
Starcraftmazter
- Forum Commoner
- Posts: 45
- Joined: Mon Apr 24, 2006 11:36 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
This is likely against their Terms of Use. I'm only going to give you limited help until you can show me it's not.
To make multiple page requests while gathering output you can use cURL, although make sure you use the same handler across all requests. Then use preg_match() to capture whichever data you want.
To make multiple page requests while gathering output you can use cURL, although make sure you use the same handler across all requests. Then use preg_match() to capture whichever data you want.
-
Starcraftmazter
- Forum Commoner
- Posts: 45
- Joined: Mon Apr 24, 2006 11:36 pm