[英]jsoup: selecting table without specific ID that contains certain text string (select two conditions)
我正在嘗試從以下論壇中提取引號: http : //forum.xda-developers.com/showthread.php?t=1772338
所有與:
Elements postquote = doc.select("table[cellpadding=6][cellspacing=0]");
但是:這個特定線程中的問題是,編輯器使用了引號格式來格式化其文本,而不是引用另一個用戶。
我的方法是偶爾搜索“原始發布者”
Elements postquote = doc.select("table[cellpadding=6][cellspacing=0], table:contains(Originally Posted by)");
如果要查找還包含Originally Posted by
table[cellpadding=6][cellspacing=0]
,則只需使用
doc.select("table[cellpadding=6][cellspacing=0]:contains(Originally Posted by)").
另外,
代表OR
所以它將嘗試查找somethingLikeThis
或somethingLikeThat
以便生成其他結果,而不是縮小它們的范圍。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.