php - How get html from remote url? -


goood day.

i have link

if open link in blowser see window test

i html element id tarifvalue

for use code:

$ch = curl_init();  curl_setopt($ch, curlopt_url, 'http://www.russianpost.ru/autotarif/autotarif.aspx?viewpost=26&countrycode=643&typepost=1&viewpostname=undefined&countrycodename=%d0%a0%d0%be%d1%81%d1%81%d0%b8%d0%b9%d1%81%d0%ba%d0%b0%d1%8f%20%d0%a4%d0%b5%d0%b4%d0%b5%d1%80%d0%b0%d1%86%d0%b8%d1%8f&typepostname=undefined&weight=1100&value1=2650&postofficeid=123456'); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_header, 0);  $output = curl_exec($ch);  curl_close($ch); 

but echo $output show next code:

<html> <head></head> <body onload="document.myform.submit();"> <form method="post" name="myform" style="visibility:hidden;"><input id="key" name="key" value="497947"> <input type="submit"> </form> </body> </html> 

tell me please how rigth html when me need ?

you can try parser http://simplehtmldom.sourceforge.net/. 1 of best found far.

$html = file_get_html("http://www.russianpost.ru/autotarif/autotarif.aspx?viewpost=26&countrycode=643&typepost=1&viewpostname=undefined&countrycodename=%d0%a0%d0%be%d1%81%d1%81%d0%b8%d0%b9%d1%81%d0%ba%d0%b0%d1%8f%20%d0%a4%d0%b5%d0%b4%d0%b5%d1%80%d0%b0%d1%86%d0%b8%d1%8f&typepostname=undefined&weight=1100&value1=2650&postofficeid=123456");  echo $html->find("#tarifvalue", 0).textcontent; 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -