Search the web
Sign In
New User? Sign Up
phpexperts
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
PHP website conversion to plain text   Message List  
Reply Message #13277 of 13397 |
[phpXperts] grabbing using xpath problem

Hello friends,
 
I want to grab an href attribute of first anchor tag from this link  http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links
 
 
I am using the code
 
$fromurl='http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links';
 $html = getDocument($fromurl);
$dom = new DOMDocument();
@$dom->loadHtml($html);

 
$xpath = new DOMXPath($dom);
 
$content = $xpath->query('//a[@class="wl"]');
 
echo $content->length;
 
echo 'Title: ' . $content->item(0)->childNodes->item(0)->nodeValue . '<br />';
echo  $content->getAttribute('href');


 
It was working previously but now href attribute value is not appearing. It only shows "Thanksgiving".
I want to grab this value "/Heroes/_watchlinkviewer/37244"
 
 
Can you please help me.
 
Regards
Gotu
 
 


Windows 7: Find the right PC for you. Learn more.

Thu Nov 26, 2009 10:11 am

gotu_d2006
Offline Offline
Send Email Send Email

Message #13277 of 13397 |
Expand Messages Author Sort by Date

Working on a project and it needs to pull the data from shoutcast.com. I am pulling the song history data and find it writes everything on one single line. I...
shorts732
Offline Send Email
Nov 25, 2009
12:56 am

<?php function URLopen($url) { $dh = fopen($url,'r'); $result = ''; while(!feof($dh)) { $result .= fread($dh,8192); } return $result; } ...
invarbrass
Offline Send Email
Nov 25, 2009
7:01 am

$data = file_get_contents('http://kmgx.phirefast.com:8300/played.html');...
invarbrass
Offline Send Email
Nov 25, 2009
7:02 am

Hello friends, I want to grab an href attribute of first anchor tag from this link http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links I am...
Gautam Kumar
gotu_d2006
Offline Send Email
Nov 26, 2009
10:54 am

Hi Gautam, I didn't quite understand how your getDocument function worked, so i declared my own function which retrieves the html file and returns it as a ...
Krishna Shasankar
shasankar
Offline Send Email
Nov 27, 2009
9:29 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help