Hi im using simple HTML DOM as seen here http://simplehtmldom.sourceforge.net/manual.htm my question is, how to parse a "https" url? page that needs certificate
Try this : $ch=curl_init(); curl_setopt($ch,CURLOPT_URL,'https://site.domain/page'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); $buffer = curl_exec($ch); curl_close($ch); //$buffer contains the page's content PHP:
Well , tell me the page you are trying to parse... as it worked for the https page I've tested the code with...
hmm... its not a possiblity, theres a user authentication on that page, and requires login. thanks for the info though.
i asked about the host, it requires a proxy... ssl or socks, do you have any curl code that can connect behind proxy?
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.example.com'); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_PROXY, 'fakeproxy.com:1080'); curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'user:password'); $data = curl_exec(); curl_close($ch); ?> PHP: