I am using the code bellow to get some content. My problem is that i don't know how to avoid/bypass/remove a specific div.

我正在使用下面的代码来获取一些内容。我的问题是我不知道如何避免/绕过/删除特定的div。

html Structure:

<div class="post-single-content box mark-links">
<div class="sharebar-wrap">dfdfdfd</div>
</div>

And i an using the code bellow to get the content:

我使用下面的代码来获取内容:

foreach($html->find('div[class=post-single-content box mark-links]') as $table)
{
$arr44[]=  $table->innertext ;
}

How can avoid or remove or bypass to grab the div with class sharebar-wrap? I don't need it!

如何避免或删除或绕过使用class sharebar-wrap获取div?我不需要它!

Cheers!!

2 个解决方案

#1


You can indeed use jQuery as Héctor E mentioned, otherwise you can use raw javascript :

您确实可以使用jQuery作为HéctorE提到,否则您可以使用原始javascript:

document.querySelector('.sharebar-wrap').remove();

更多相关文章

  1. php二维码/26行代码制作php二维码phpqrcode加grafika水印
  2. php分页代码的问题,显示了两个当前页码,求大神解答
  3. PHP开发微信支付代码及支付通知处理
  4. 请问如何用php实现表单提交后以邮件的形式把表单内容发到邮箱中
  5. 使用pregex提取最后2个斜杠之间的内容
  6. HPH+Mysql注入点利用 读取文件内容和导出一句话木马
  7. 几个有用的php字符串过滤,转换函数代码
  8. 在Web Page中包含PHP代码
  9. 刷新php页面而不重载内容?

随机推荐

  1. Android客户端GPS定位
  2. android 使用VideoView加载raw目录内视频
  3. Android 入门笔记 之 网址
  4. 写信息的界面
  5. 初步了解Android
  6. Android(安卓)TextView设置图片技巧
  7. Android studio build inished with non-
  8. 分享android技术牛人博客
  9. Android:解决列表滚动时背景色变黑的方法
  10. Android 文件实现断点上传