[英]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)");
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
所以它将尝试查找somethingLikeThis
或somethingLikeThat
以便生成其他结果,而不是缩小它们的范围。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.