Jump to content

Getting HTML output from HTTP request


shadowayex

Recommended Posts

What I'm looking to do is parse the HTML output from a page on a different server. There's a page with some useful information that I would like to grab and use myself, but it is updated regularly. So, rather can copy the information and use it myself, I thought it'd be nice if I could load up that HTML into a DOMDocument and parse out the parts I want.I know what to do from the DOMDocument on, I just don't know how to get the HTML to put in the DOMDocument. How would I do that?

Link to comment
Share on other sites

You can just use file_get_contents() over HTTP - if your host has disabled that, there are other functions you can use, such as cURL.

Link to comment
Share on other sites

You can just use file_get_contents() over HTTP - if your host has disabled that, there are other functions you can use, such as cURL.
This seemed to work for what I was doing. Thanks =)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...