-1
I’m trying to fetch data from a process (TRF site) with file_get_contents and nothing comes. When I paste the url into the browser, it comes. I’ve tried thousands of examples I’ve found on the Internet and nothing. I’ve tried the GET and POST methods and nothing. Follows my code:
$url = "https://processual.trf1.jus.br/consultaProcessual/arquivo/partes.php?proc=01303264620144019198&secao=TRF1&origem=juris";
$postdata = http_build_query(
array(
'proc' => '01303264620144019198',
'secao' => 'TRF1',
'origem' => $origem
)
);
$opts = array('http' =>
array(
'method'=>'GET',
'header' => array(
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*\/*;q=0.8',
'Accept-Encoding: gzip, deflate, sdch',
'Content-Type: text/html; charset=utf-8',
'Content-type: application/x-www-form-urlencoded',
'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language:en-US,en;q=0.8',
'Cache-Control:max-age=0',
'Connection:keep-alive',
'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36',
'Content-type: application/x-www-form-urlencoded'
),
'content' => $postdata,
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*\/*;q=0.8',
'User-Agent: '.$_SERVER['HTTP_USER_AGENT'],
'request_fulluri' => True,
'ignore_errors' => true,
),
'ssl' => array(
'verify_peer' => true,
'ciphers' => 'HIGH:TLSv1.2:TLSv1.1:TLSv1.0:!SSLv3:!SSLv2',
'disable_compression' => true
)
);
$context = stream_context_create($opts);
$dadosBrutos = file_get_contents($url, false, $context);
I copied your url, and pasted it in the browser and the message I got in response was "No part found for the searched process."
– Wictor Chaves
And right now I’m trying and it’s giving error in the url. As if trf1 had blocked the query or my ip.
– mvascs
Here returned a blank page,
– Bulfaitelo