[Q] PHP equivalent of perl WWW::Mechanize?

by Joe118
7 replies
Is there such a thing?
#equivalent #perl #php #wwwmechanize
  • Profile picture of the author mgkimsal
    Have a look at Snoopy for PHP - Snoopy | Get Snoopy at SourceForge.net

    Also, the Zend HTTP Client (in the Zend Framework) might fit the bill too.
    {{ DiscussionBoard.errors[1311167].message }}
  • Profile picture of the author Joe118
    Snoopy looks great, many thanks!!!!
    {{ DiscussionBoard.errors[1311786].message }}
    • Profile picture of the author Joe118
      Any other options? Thanks for those that were presented so far..
      {{ DiscussionBoard.errors[1314011].message }}
      • Profile picture of the author mgkimsal
        Originally Posted by Joe118 View Post

        Any other options? Thanks for those that were presented so far..
        Snoopy not doing it for you?
        {{ DiscussionBoard.errors[1314330].message }}
      • Profile picture of the author mgkimsal
        Originally Posted by Joe118 View Post

        Any other options? Thanks for those that were presented so far..
        Snoopy not doing it for you? I'm out of ideas at the moment - my needs don't normally go much beyond file_get_contents("http://whatever.com") You *can* get fancy and put header and user agent stuff and cookies and all that in your file functions (fopen, fputs, fgets, etc) by creating contexts and passing them as parameters to the file streams. It's a bit advanced, and (imo) not well documented with tutorials, but that might be a direction to go in.

        Good luck.
        {{ DiscussionBoard.errors[1314334].message }}
  • Profile picture of the author Joe118
    I need to do cookie management, form submission, etc etc etc... Anything and everything to automate websites.

    I think snoopy will do it for me, yes. Not sure yet. I want a few other alternatives so I can synthesize
    {{ DiscussionBoard.errors[1317559].message }}
  • Profile picture of the author MemberCon
    It's not as high-level as WWW::Mechanize or Snoopy, but I generally turn to cURL (PHP: cURL - Manual) for this type of interaction with web pages.

    It can handle POSTing (Execute a HTTP POST Using PHP CURL) and cookies (PHP cURL Cookies Example)
    {{ DiscussionBoard.errors[1322899].message }}

Trending Topics