SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot wh33t's Avatar
    Join Date
    Aug 2011
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP parse html source from a web site that requires you to login?

    Hey SP,

    I'm curious if it's possible to get PHP to parse html source code from a privately accessed area on a website. I know that PHP can do this relatively easy with web pages that are pubicly accessible but how can I get PHP to login and create the a session complete with cookies and all. My clients currently look up information on a website which they pay a monthly fee to. I'll state that we aren't trying to compete with them, as their service actually supports our business. We would just like to speed up the process in which we look up information on their website. So I'll re-iterate that again, we aren't stealing anything from the service, we already pay for the service, we'd just like to be able to access the information we pay for in a format that works with our business instead of against it.

    So is this kind of thing possible with PHP? Any tips in the right direction would be a great help.

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,149
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    The Symfony2 components can be used to make a handy scraper that can simulate the behavior of a browser, including filling and submitting forms, and managing cookies and history.

    https://github.com/fabpot/Goutte

  3. #3
    SitePoint Zealot wh33t's Avatar
    Join Date
    Aug 2011
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    The Symfony2 components can be used to make a handy scraper that can simulate the behavior of a browser, including filling and submitting forms, and managing cookies and history.

    https://github.com/fabpot/Goutte
    Wow, thank you for the suggestion. I don't have any experience with .phar files but it looks like I can use it like any other class I would include?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •