|
|
#1 |
|
Groupie
![]() Posts: 180
Karma: 10
Join Date: May 2012
Device: Kindle Paperwhite2
|
More than one page of TOC?
Code:
INDEX = 'http://....' soup = self.index_to_soup(self.INDEX) |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,598
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
soup2 = self.index_to_soup(INDEX2)
|
|
|
|
|
|
#3 |
|
Groupie
![]() Posts: 180
Karma: 10
Join Date: May 2012
Device: Kindle Paperwhite2
|
|
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,598
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
no .
|
|
|
|
|
|
#5 |
|
Groupie
![]() Posts: 180
Karma: 10
Join Date: May 2012
Device: Kindle Paperwhite2
|
I'm still a bit confused.
Code:
def parse_index(self):
articles = []
soup = self.index_to_soup(self.INDEX)
feeds = []
for section in soup.findAll('div'):
...
for post in section.findAll('li'):
...
if articles:
feeds.append((section_title, articles))
return feeds
UPDATE: I tried two for loops and got all the articles. But articles under the same section name was split. For example, if in both page 1 and page 2 there's a section called "ABC", then two sections with the name "ABC" appear in TOC. How can I avoid that? Last edited by Steven630; 03-14-2013 at 10:22 AM. |
|
|
|
|
|
#6 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,598
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Append the articles from the second section into the first.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Page Mapping Using toc.ncx | lorddon | ePub | 35 | 01-16-2018 12:18 PM |
| Page break for chapters/TOC? | neonbible | Conversion | 2 | 08-28-2012 09:53 AM |
| Generated TOC links back to TOC page in the book | Caleb666 | Sigil | 7 | 08-17-2011 11:58 AM |
| How to make a TOC page? | violent23 | Sigil | 20 | 12-07-2010 11:20 AM |
| Converting a web page to epub with TOC | philosopherdog | Calibre | 5 | 07-23-2010 07:55 AM |