duansha7025 2012-05-05 11:18
浏览 25

如何使用file_get_contents编辑抓取的内容

I grabbed some urls and titles by using file_get_contents. Now I want to edit them and display in my page. But I don't think its possible.

$html = file_get_html($gg_url);
// find all div tags with id=s
$ttt = $html->find('div.s');

The result is:

www.example.com and bla bla bla under that DIV

But that url is tagged like this <cite>www.exaple.com</cite>.

All I need is that url inside the result but whole thing (url + other text) is in one variable. Is there a way to get that url?

  • 写回答

1条回答 默认 最新

  • dpiz9879 2012-05-05 11:25
    关注
    $html = file_get_html($gg_url);
    $ttt = $html->find('cite')->innertext;
    echo $ttt;
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思