|
|
#1 |
|
Zealot
![]() Posts: 122
Karma: 10
Join Date: May 2012
Device: Kindle Touch
|
captureing all articles but all under the first section
Code:
<div class='module'> <h3>Section1</h3> <ul> <li> <h4>articles links and article titles</h4> </li> ……(other articles) </ul> <h3>Section2</h3> <ul> <li> <h4>articles links and article titles</h4> </li> …… (other articles) </ul> But it turned out that though all the articles were fetched correctly, they all end up in the first section.But I am at a loss what to do, since all section names are included in "h3", and unlike webpage of built-in recipes, <div class='module'> appears only before the first section, not every section (which I think explains the failure). Can anyone help me out? Just a quick answer is appreciated. Last edited by Steven630; 07-19-2012 at 03:52 AM. |
|
|
|
|
|
#2 |
|
Zealot
![]() Posts: 122
Karma: 10
Join Date: May 2012
Device: Kindle Touch
|
I think it has something to do with section.find('h3') this only find the first one. But when I changed this to section.findAll('h3') , it failed to fetch anything (not even the first section).
|
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Zealot
![]() Posts: 122
Karma: 10
Join Date: May 2012
Device: Kindle Touch
|
Just edited the thread starter to reflect a string I didn't mention.
|
|
|
|
|
|
#4 |
|
Zealot
![]() Posts: 122
Karma: 10
Join Date: May 2012
Device: Kindle Touch
|
I changed the recipe and made every single "ul" as a section, leaving out section title. This time, Calibre correctly divided articles into several sections. But the drawback is that each section has no name. I'm thinking about grabbing h3 and add those to section names. Is that possible? Or can I just enter the section name in the recipe one by one?
|
|
|
|
|
|
#5 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,485
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
When you find a ul use ul.findPreviousSibling('h3') to get the title. Read the beautifulsoup documentation, it will teach you how to do this, and many other things.
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#6 |
|
Zealot
![]() Posts: 122
Karma: 10
Join Date: May 2012
Device: Kindle Touch
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kindle Fire: also missing "section/articles" in all news | mkgtu | Devices | 3 | 11-21-2011 10:14 AM |
| What do you think I would ask for in this section? | Saras | Which one should I buy? | 4 | 01-20-2011 03:15 PM |
| cant seem to keep my articles! | marbs | Recipes | 2 | 11-18-2010 12:56 PM |
| PRS-600 Articles like this | scottjl | Sony Reader | 31 | 12-30-2009 05:41 AM |