2017-07-02 12 views
0

レポートビューアを使用するページのデータを処理したいと考えています。このビューアのデータはCURLコードでは見つかりません。レポートビューアからPHPおよびCURLを取得する

Page URL

ページは、このサイトに属している:fiscalizandocomtce

<?php 
    $curl = curl_init("http://reportviewer.tce.mg.gov.br/default.aspx?server=noruega&relatorio=SICOM_Consulta%2f2017%2fModulo_AM%2fDetalhamentos%2fUC31-DetContratos-RL&contrato=8678102&periodoSelecionado=0&remessaSelecionada=662325639,668743165,674898703,675479698,682749064,682749296,682752194,684843149,687617053,689543045,689556683,689827842,690502542&orgaoSelecionado=11938&exercicioSelecionado=2017"); 
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); 

    $page = curl_exec($curl); 

    if(curl_errno($curl)) // check for execution errors 
    { 
     echo 'Scraper error: ' . curl_error($curl); 
     exit; 
    } 

    echo $page; 
?> 

私もsimple_html_domを使用してみましたが、それはまた、問題のページのレポートビューアからデータを取り込むことができません。

<?php 

include('simple_html_dom.php'); 

$html = file_get_html('http://reportviewer.tce.mg.gov.br/default.aspx?server=noruega&relatorio=SICOM_Consulta%2f2017%2fModulo_AM%2fDetalhamentos%2fUC31-DetContratos-RL&contrato=8678102&periodoSelecionado=0&remessaSelecionada=662325639,668743165,674898703,675479698,682749064,682749296,682752194,684843149,687617053,689543045,689556683,689827842,690502542&orgaoSelecionado=11938&exercicioSelecionado=2017'); 

// extract text from HTML 
echo $html->plaintext; 
?> 

私が言及した2つ以外の方法はありますか? 助けてくれてありがとう!

+0

https://github.com/guzzle/guzzle – mkaatman

答えて

0

まず、ブラウザでURLが開いているかどうかを確認します。 は、第二に、それはのfile_get_contents であり、あなたは答えを

+0

感謝をHTMLドキュメントを横断するPHPののDOMDocumentクラスを使用し、必要なデータをこすりすることができます。私はfile_get_contentsに変更しました。レポートデータの後ろにはありません。私はまた、私のブラウザで開かれているリンクを理解していない、それは干渉することができますか? – ffaelcdec

関連する問題