PHP Classes

Simulating web browser

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  Simulating web browser  >  (Un) Subscribe thread alerts  
Subject:Simulating web browser
Summary:I want to access the website that prohibit automated browsing...
Messages:2
Author:Petar
Date:2007-10-19 13:01:30
Update:2007-10-19 16:20:40
 

  1. Simulating web browser   Reply   Report abuse  
Picture of Petar Petar - 2007-10-19 13:01:30
Hi,

Could you please give me some instruction how to use your clas to:

- open the webpage (http://www.domain.com/)
- post a form request
- retrive data
- delete any cookies the webiste may store.

I want to do this with the class simulating IE. I have to be sure the website is not able to understand that i use the class instead of manually browsing the site using web browser.

there is no usrname/password/login and etc...

the webpage prohibit automated browsing using any kind of scripts...

Lots of thanks!

  2. Re: Simulating web browser   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-10-19 16:20:40 - In reply to message 1 from Petar
That depends on what the site does to check if it is a real browser.

Usually setting the user agent string to a real browser identification like this will do:

$http->user_agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";

Some sites use Javascript to perform further verifications. It may be harder to work around such verifications usually that is possible.