PHP wont load XML file -


this question has answer here:

i writing web app , trying access rss feed financial times. when run code following error. hoping tell me i've went wrong.

function getftrss(){     //create object parse xml input finanial time's uk companies rss feed     $rssfeed = new domdocument();     //gather information , load object     $rssfeed->load('http://www.ft.com/rss/companies/uk');     $articles = array();     //lookp through elements in xml document     foreach($rssfeed->getelementsbytagname('item') $newsartcle){         $title = $newsartcle->getelementsbytagname('title')->item(0)->nodevalue;         $desc = $node->getelementsbytagname('description')->item(0)->nodevalue;         $link = $node->getelementsbytagname('link')->item(0)->nodevalue;         $date = $node->getelementsbytagname('pubdate')->item(0)->nodevalue;          echo   '<li class="list-group-item news-item"  onclick="window.location=\'$link\'">                     <h3 class=\'top-element\'>$title</h3>                     <h4>$desc</h4>                     <h5>$date</h5>                 </li>';     } } 

i following error program:

warning: domdocument::load(http://www.ft.com/rss/companies/uk): failed open stream: http request failed! http/1.0 403 forbidden in /home/ubuntu/workspace/mot/includes/functions.php on line 46 

have checked request out of php ? noticed don't accept requests bad ua check screenshot below;

update: yes not accept bad ua, should change data fetching method.

user-agent


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -