简体   繁体   English

jsoup:选择不包含包含某些文本字符串的特定ID的表(选择两个条件)

[英]jsoup: selecting table without specific ID that contains certain text string (select two conditions)

I'm trying to extract the quotes from the following forum: http://forum.xda-developers.com/showthread.php?t=1772338 我正在尝试从以下论坛中提取引号: http : //forum.xda-developers.com/showthread.php?t=1772338

All worked with: 所有与:

Elements postquote = doc.select("table[cellpadding=6][cellspacing=0]");

BUT: The problem in this particular thread is, that the editor used the quoting-format to format his text and not to quote another user. 但是:这个特定线程中的问题是,编辑器使用了引号格式来格式化其文本,而不是引用另一个用户。

My approach was to search aditionally for "Originally Posted by" 我的方法是偶尔搜索“原始发布者”

Elements postquote = doc.select("table[cellpadding=6][cellspacing=0], table:contains(Originally Posted by)");
  • How can I combine two ore more select conditions? 如何将两个或多个选择条件组合在一起? (Jsoup syntax states "," but that does not work) (Jsoup语法声明为“,”,但这不起作用)
  • What's wrong? 怎么了? How could I extract the REAL Posts more easy? 我怎样才能更轻松地提取REAL帖子?

If you want to find table[cellpadding=6][cellspacing=0] that also contains Originally Posted by then just use 如果要查找还包含Originally Posted by table[cellpadding=6][cellspacing=0] ,则只需使用

doc.select("table[cellpadding=6][cellspacing=0]:contains(Originally Posted by)"). 

Also , represents OR so it will try to find somethingLikeThis OR somethingLikeThat so it will generate additional results rather than narrowing them. 另外,代表OR所以它将尝试查找somethingLikeThissomethingLikeThat以便生成其他结果,而不是缩小它们的范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM