11-19-2011, 01:01 PM | #1 |
Junior Member
Posts: 1
Karma: 10
Join Date: Nov 2011
Device: Kindle Keyboard 3G
|
Priority between keep_only_tags and remove_tags
Hi,
I'm new to the recipe API and I'm trying to write a simple recipe. Suppose that I have an element i want to keep and I add it to keep_only_tags. However, the node is a descendant of some content i want to filter out, which I add to remove_tags. Will the node from keep_only_tags appear in the processed page, or will it be lost while filtering out its parent? I don't see it in the processed page, so I just want to make sure this is intended and I don't have a bug in the code. |
11-19-2011, 04:10 PM | #2 |
onlinenewsreader.net
Posts: 324
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
|
First the keep only tags are extracted. Then the remove after and remove before tags are processed. Finally the remove tags are processed. So the content you want must first be contained with a keep only tag, and then not excluded via remove after/before and remove directives. The logic is in web/fetch/simple.py in case you want to look at it.
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Job Priority Normal in Windows 7 | DoctorOhh | Calibre | 2 | 10-05-2011 12:31 AM |
remove_tags does not work | JFS-NMF | Recipes | 1 | 03-04-2011 02:56 PM |
Help Please: remove_tags doesn't work in WSJ Chinese | Jmot | Recipes | 5 | 02-21-2011 05:10 AM |
keep_only_tags and findAll | boocko | Recipes | 3 | 11-18-2010 12:59 PM |
keep_only_tags | ultimatebuster | Calibre | 4 | 03-19-2010 08:49 PM |