Update webpagetool.php
This commit is contained in:
parent
f73baa6165
commit
8154e46bdc
|
@ -66,9 +66,9 @@ if(!function_exists("get_web_json")) {
|
||||||
function get_web_json($url, $method="get", $data=array(), $proxy="", $ua="", $ct_out=45, $t_out=45) {
|
function get_web_json($url, $method="get", $data=array(), $proxy="", $ua="", $ct_out=45, $t_out=45) {
|
||||||
$doc = array();
|
$doc = array();
|
||||||
|
|
||||||
$raw = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out);
|
$response = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out);
|
||||||
if($raw['size'] > 0) {
|
if($response['size'] > 0) {
|
||||||
$doc = json_decode($raw);
|
$doc = json_decode($response['content']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $doc;
|
return $doc;
|
||||||
|
@ -78,12 +78,12 @@ if(!function_exists("get_web_json")) {
|
||||||
if(!function_exists("get_web_dom")) {
|
if(!function_exists("get_web_dom")) {
|
||||||
function get_web_dom($url, $method="get", $data=array(), $proxy="", $ua="", $ct_out=45, $t_out=45) {
|
function get_web_dom($url, $method="get", $data=array(), $proxy="", $ua="", $ct_out=45, $t_out=45) {
|
||||||
$html = new stdClass();
|
$html = new stdClass();
|
||||||
$raw = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out);
|
$response = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out);
|
||||||
|
|
||||||
// load simple_html_dom
|
// load simple_html_dom
|
||||||
if($raw['size'] > 0) {
|
if($response['size'] > 0) {
|
||||||
loadHelper("simple_html_dom");
|
loadHelper("simple_html_dom");
|
||||||
$html = function_exists("str_get_html") ? str_get_html($raw) : $html;
|
$html = function_exists("str_get_html") ? str_get_html($response['content']) : $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user