Quote:
Originally Posted by TonytheBookworm
I agree but I like to change things up from time to time. That's how i learn by doing things differently. Kinda like driving to work every day. Same ol road same ol trees same ol houses. But if i go a different route I might discover something different. Anyway, I see your point.
|
I do that, too - try to accomplish something a different way to make sure I understand it. There's nothing wrong with that, but you can see that it confused me, so it may confuse others who look at your recipe. I came to the obfuscated options very late, and tend to think of them as the "last resort," so I start looking for what tricky problem the site has that requires doing it that way. I get confused when I can't find the reason that obfuscation is specified.
For others: what Tony and I are talking about is that Tony has used a sophisticated option to download a page from the article, then "click" on a button on that page to get the print version. It works just like your browser works by setting up an internal browser session. To use his code, you use a regex to "find" and click the button on the downloaded page that gets the print version.
Kovid has what I consider to be a more straight forward way of getting the print version. You look at the page, find the same link that Tony's code searches for, and tell your recipe to modify the article link to go directly to the print version page. It skips the steps of setting up an internal browser, downloading the page locally, keeping track of cookies, searching in that page via the regex for the link, then clicking the print version button. Tony's obfuscated method works when there's no way to figure out how to change the article link to the print version link, or where the site requires certain cookies to be set before you can get the print version.
Both work for normal print version links, and Tony's code works in more situations than the simpler code (i.e. when the link really is "obfuscated"), but at the cost of slightly greater complexity and slower speed. Each recipe author uses their own techniques.