11-13-2010, 10:13 AM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Nov 2010
Device: Kindle
|
WashPost recipe with sign-in
I have a paid subscription to the physical print edition of the Washington Post. However, I would also like to read it on my Kindle. The Post offers full access to its electronic print edition with a free registration. I wrote a recipe using the needs_subscription=true option, which works for the first few articles. Afterwords, though, the article URL returns a page to sign in (again?). Any ideas? I've attached my recipe. I've tried various things (such as going single-threaded), but it doesn't make a difference. Uncommenting the response to the sign-in submit shows commands to set cookies with my login, so it seemed to work. The commented out section in preprocess_html to sign-in again didn't seem to help. I'd appreciate any suggestions. Thanks! Stuart.
|
11-13-2010, 02:32 PM | #2 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Try using the get_obfuscated_article method, it gives you more control.
|
Advert | |
|
11-18-2010, 07:00 AM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Nov 2010
Device: Kindle
|
Using get_obfuscated_article is a bit overkill, I think. I've been using self.log(soup.prettify()) in preprocess_html() to see the contents. The problem is that I need the URL to re-fetch after doing the sign-in. The advantage of get_obfuscated_article is that it is passed the URL, but I didn't want to deal with the output file. Instead, I overrode fetch_article() to hold onto the URL so I could grab it inside preprocess_html(). While I imagine this forces me to a single thread, the performance is fine (since it is a daily download at 4am). I'm attaching my solution, but I'll continue to tweak it. As for access to the URL and other article attributes, I'm going to start another thread to ask about that. Thanks for the help so far.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recipe works when mocked up as Python file, fails when converted to Recipe | ode | Recipes | 7 | 09-04-2011 04:57 AM |
Has anyone in the UK seen any sign on their K3 shipping? | Josieb1 | Amazon Kindle | 308 | 09-25-2010 05:26 AM |
Sign Hijacking | Fat Abe | Lounge | 2 | 05-27-2010 12:57 PM |
Texans, sign in!! | desertgrandma | Lounge | 51 | 05-14-2009 04:52 PM |
greetings from just under the hollywood sign | basschick | Introduce Yourself | 7 | 05-30-2008 11:16 PM |