Skip to content

Commit 86b8a44

Browse files
committed
Moved back to using guzzle so expections are thrown when their was an error with loading a url
1 parent f9128ac commit 86b8a44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PHPHtmlParser/Dom.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,13 @@ public function loadFromFile($file)
127127
*
128128
* @param string $url
129129
* @chainable
130+
* @throws \Guzzle\Http\Exception\...
130131
*/
131132
public function loadFromUrl($url)
132133
{
133-
$content = file_get_contents($url);
134+
$client = new Client($url);
135+
$response = $client->get()->send();
136+
$content = (string) $response;
134137

135138
return $this->loadStr($content);
136139
}

0 commit comments

Comments
 (0)