04-04-2011, 12:07 PM | #1 |
Member
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
My first recipe YeY! I have a question though...
Hi Guys,
I finally made my first recipe and so far so good (thanks calibre!). However, I was wondering if you guys can point me in the right direction (I really feel that my question is very stupid, but i read in this forum that the stupid question is the one that's not asked). First let me say that I have no idea what python is and a very basic knowledge of HTML, but I find this very interesting and the potential to be great! So I am trying to learn... Anyways, my question is this, can you guys point me in the right direction on how I can include the images on the articles? This is the link of the one I am working on: http://blog.mysanantonio.com/spursnation/feed/ So far everything is okay, but the images are not showing and I have no idea why... I tried playing around with remove_tags_before/after and keep_only_tags/remove_only_tags but no success yet... Sorry for the rant and I really do appreciate the help! |
04-04-2011, 01:27 PM | #2 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
IOW, your first job is to figure out whether the images are missing because of something you are doing, or something the website is doing. |
|
04-04-2011, 02:24 PM | #3 |
Junior Member
Posts: 8
Karma: 10
Join Date: Apr 2011
Device: Kindle 3
|
Give a try to keep_only_tags = [dict(name='div',attrs={'class':'post-contents clearfix'})])].
You should have everything you want with this parameter. |
04-04-2011, 09:38 PM | #4 | |
Member
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
Quote:
Hi and thank you very much for the help, I should have been more clear earlier, I actually started with just the basic recipe, only giving a title and the url of the feed (just like in the tutorial) and everything is fine I can read the whole article and as far as I can tell no extra junk from the site. Then I tried the Economist and I noticed that it include images so I tried playing around with it to try and add the image from the articles... that's why I used the tag removal options. Last edited by audreypots; 04-04-2011 at 09:44 PM. Reason: wrong spelling :D |
|
04-04-2011, 09:43 PM | #5 | ||
Member
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
Quote:
Quote:
|
||
04-05-2011, 08:00 AM | #6 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Do you get images without any keep_only_tags or remove_tags, etc. in your recipe? If not, changing those functions will never produce images. You should always post your recipe if you want others to look at it.
Last edited by Starson17; 04-05-2011 at 08:46 AM. |
04-05-2011, 08:50 AM | #7 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
If you didn't have images, then everything wasn't fine, but if you had images, then why would you have " tried playing around with it to try and add the image from the articles"? If you did not have images with the basic recipe, the tag removal options won't improve anything. |
|
04-05-2011, 10:43 AM | #8 | |
Member
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
Quote:
|
|
04-05-2011, 10:54 AM | #9 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
04-06-2011, 08:57 AM | #10 | |
Member
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
Quote:
Hi, This is my code, I am afraid it's very basic: Spoiler:
|
|
04-06-2011, 11:08 AM | #11 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
That's OK, 1) I prefer to see what you're actually using, 2) it saves me time in organizing the basic structure, and 3) I'm sure you really are interested enough to post.
I ran your recipe and tracked it back at least far enough to see that the site is sensitive to all sorts of issues. If you turn off cookies in Firefox, or block the cookie in TamperData, you get no images. If you send no UserAgent, you get no images, etc. i suspect it may also be sensitive to other headers, like the accept header, etc. Normally, the recipe system will provide basic cookie handling and it sends a default UserAgent. Something else is likely to be the problem. I had a site that needed an Accept header that Calibre was not sending to get past the Bad Behavior module. I regret that I don't have time to solve the problem for you. Search for some of my posts on Accept headers, Bad Behavior, cookies, etc. to see how to track the HTTP handshaking, cookies and headers. You would need to see what Calibre sends, match that to the minimum that the site finds acceptable. |
04-07-2011, 06:04 AM | #12 | |
Member
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
Quote:
Thank you so much! Please no regrets (i do not know the exact phrase to reply, but I hope you get my point), as I wasted some of your time already. All I really need is a little nudge on the right the direction, a few days ago I don't even know the problem now I can concentrate! Again many many many thanks! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom recipe question | jdomingos76 | Recipes | 1 | 02-10-2011 07:46 AM |
Question about Seattle Times Recipe (adding a section list) | kingsinger | Recipes | 2 | 01-17-2011 10:47 PM |
New to Calibre - Recipe/HTML question | ClairePMR | Calibre | 3 | 07-23-2010 11:53 AM |
Question on TheAtlantic News Recipe | gilamon | Calibre | 6 | 11-05-2008 03:07 PM |
Calibre recipe Question | astrodad | Calibre | 3 | 05-23-2008 01:05 PM |