Potentially useful code snippets
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
486 B

import requests as r
from bs4 import BeautifulSoup as bs
import pypub
import os
#page = r.get('http://gutenberg.net.au/ebooks06/0600811h.html')
#pagetext=page.text
#cleanpage=pypub.clean( pagetext )
book= pypub.Epub('Book Title', creator="Robert E Howard", publisher='Project Gutenberg Australia')
#xchapterone = pypub.ChapterFactory(cleanpage)
z= pypub.create_chapter_from_url('http://gutenberg.net.au/ebooks06/0600811h.html')
book.add_chapter(z)
book.create_epub( os.getcwd() )