View Single Post
Old 06-13-2010, 09:01 AM   #2095
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by lordvetinari2 View Post
I am trying to create a new recipe for Publico PT, because the bundled one does not work any more. I tried fixing it, but there was a regexp there that I do not understand.
It might be easier to just figure out this regex.

Quote:
So I tried creating my own from scratch, and it mostly works, but I have a few problems.

The main problem is that certain parts of the website work differently, for some reason. Now, my recipe is checking for certain tags to remove unnecessary items (menus, icons, etc), and not every section uses the same tags. For instance, "http://economia.publico.pt/Noticia/g...e-2013_1441633" has the main article inside a div id="content", but the article "http://desporto.publico.pt/noticia.aspx?id=1441651" has a the main article inside a div class="containerMain". As my recipe stands now, when it does not find the tag defined under "keep_only_tags", it just returns an empty page. Is there any way to say, "check for this tag and if it's not there, check for the other one instead"?
Yes - sort of, but why not just keep both tags instead of making it conditional? It should work just as well, unless both tags are used on the same page.

Last edited by Starson17; 06-13-2010 at 09:05 AM.
Starson17 is offline