I'm trying to get the title from a link - which I already 开发者_StackOverflow社区have identified, it is just the last bit with retrieving the title from the same link.
To find the right link I use this code:
$html->find('a[href=http://mylink.se']');
But I also want the title from this link. How would I do that?
Assuming you're using PHP Simple HTML DOM parser, which is not clear in your question, you could do
$link = $html->find('a[href=http://mylink.se]', 0); //As the OP pointed out in comments, you need to select the first element
$title = $link->title
http://simplehtmldom.sourceforge.net/manual.htm
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论