Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute

2009-08-22 Thread Raymond Irving
here: http://raxanpdi.com/downloads.html __ Raymond Irving --- On Sat, 8/22/09, Manuel Lemos mle...@acm.org wrote: From: Manuel Lemos mle...@acm.org Subject: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute To: chrysanhy phpli...@hyphusonline.com Cc

Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute

2009-08-16 Thread chrysanhy
It did not work. Both gave me a Call to undefined method fatal error. On Sun, Aug 16, 2009 at 1:43 AM, Ralph Deffke ralph_def...@yahoo.de wrote: try $link-nodeValue() or $link-getContent() im not shure which one works on an image link which is indeed a child of a so u could also check

Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute

2009-08-16 Thread chrysanhy
WHile waiting for suggestions for extracting the link text from the DOM, I tried a brute force approach using the URLs I had found with getAttribute(), but found myself baffled by my results. I boiled down my issue with this approach to the following snippet. $htmldata =EOB

Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute

2009-08-16 Thread Ralph Deffke
well the immage goes inside the a.. img... /a on ur html the node a has no value however u should not get a error this is pergect jtml link a href=thema.htmimg src=button4.jpg width=160 height=34 border=0 alt=THEMA/a ralph chrysanhy phpli...@hyphusonline.com wrote in message

Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute

2009-08-16 Thread Ralph Deffke
this worked here: ?php $html = new DOMDocument(); $html-loadHtmlFile(testHtml.html); $links = $html-getElementsByTagName('a'); echo pre; foreach ($links as $item) { echo $item-getAttribute( 'href' ). \n; echo --- . $item-nodeValue . \n; } echo /pre; ? Im sending u the 2 files directly

Re: [PHP] Re: How do I extract link text from anchor tag as well as the URL from the href attribute

2009-08-16 Thread chrysanhy
The code snippet below worked! Thank you so much for your time helping me with this! On Sun, Aug 16, 2009 at 11:26 AM, Ralph Deffke ralph_def...@yahoo.dewrote: this worked here: ?php $html = new DOMDocument(); $html-loadHtmlFile(testHtml.html); $links = $html-getElementsByTagName('a');