Skip to content

Commit d30145c

Browse files
authored
Merge pull request paquettg#87 from ljvicente/master
added browser agent to curl options
2 parents d98f1ef + 2091d11 commit d30145c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PHPHtmlParser/Curl.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public function get($url)
2828

2929
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
3030
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
31+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
32+
curl_setopt($ch, CURLOPT_VERBOSE, true);
33+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
34+
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36');
35+
curl_setopt($ch, CURLOPT_URL, $url);
3136

3237
$content = curl_exec($ch);
3338
if ($content === false) {

0 commit comments

Comments
 (0)