Get a part of another page
I am trying to fetch a part of the page from another domain. I could directly embed as a
frame. But i need to retrieve a part of it. How can i? I use:
$.ajax({
type: "POST",
url: "marketToday.php",
data: "symbol=" + symbol,
success: function(html)
{
alert(html);
}
});
in marketToday.php:
I retrieve a pag开发者_开发百科e using curl
PHP has built-in libraries (usually included by default) for DOM manipulation. Essentially you would need to use curl or file_get_contents()
and then parse the source code with DOM or XPATH.
精彩评论