Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 11-18-2010, 07:06 AM   #1
stuartweinstein
Junior Member
stuartweinstein began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2010
Device: Kindle
Article object in preprocess_html

The method preprocess_html() gets a "soup" argument, but I have a situation where the article being fetched is a request for authentication. After doing so, one is expected to re-fetch the URL. Is the URL in the soup object or, better yet, is the article object (with title, URL, description, and date) available in the BasicNewsRecipe object (i.e., self)? I would love to add more attributes (e.g., byline) to the article object and have that available to preprocess_html() so that I can add more stuff to the fetched article. Thanks!
stuartweinstein is offline   Reply With Quote
Old 11-18-2010, 11:53 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,405
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the soup is just downloaded html. Article objects are stored in BasicNewsRecipe (IIRC under self._fetched_articles or something like that). You have access to both the soup and the article object in populate_article_metadata, however popluate_article metadata is called after postprocess_html
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AttributeError: 'NoneType' object has no attribute 'lower manada Calibre 2 08-10-2010 10:54 PM
Line' object has no attribute 'children mazzeltjes Calibre 0 02-12-2010 09:30 AM
TypeError: 'dict' object is not callable sauravishal Calibre 3 01-23-2009 06:21 PM
'list' object has no attribute 'add_book' etc. mazzeltjes Calibre 1 12-26-2008 01:12 PM
'list' object has no attribute 'add_book' drmathprog Calibre 2 11-13-2008 04:52 PM


All times are GMT -4. The time now is 03:33 AM.


MobileRead.com is a privately owned, operated and funded community.