2
我有这样一个变量:如何解析一些html标签内容,并用“|”等特殊字符分隔它们?
$content = '
<i class="fa fa-hashtag" aria-hidden="true">
<a href="http://example.com/tag/digital_marketing">digital marketing</a>
</i>
<i class="fa fa-hashtag" aria-hidden="true">
<a href="http://example.com/tag/seo">seo</a>
</i>
<i class="fa fa-hashtag" aria-hidden="true">
<a href="http://example.com/tag/internet_marketing">internet marketing</a>
</i>';
如何提取标签的内容是这样的: 数字营销|搜索引擎优化|网络营销
谢谢。
非常感谢你。 –
当我使用xpath更精确的像:// div [@ id ='tags']/a没有成功。你有什么想法Sahil? –
@MohammadJ你可以分享HTML吗?你的'XPath'看起来很好''''''''然后再试一次。 –