fix: crawl
This commit is contained in:
@@ -4,17 +4,16 @@ from tqdm import tqdm
|
|||||||
import os
|
import os
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
from convert import GBConvert
|
from convert import GBConvert, get_all_book_tags, allbooks_url
|
||||||
import utils
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
books = utils.get_all_book_tags()
|
books = get_all_book_tags()
|
||||||
# NOTE consider making this a map()
|
# NOTE consider making this a map()
|
||||||
for book in tqdm(books):
|
for book in tqdm(books):
|
||||||
book_title = book.get_text()
|
book_title = book.get_text()
|
||||||
book_url_relative = book.get('href')
|
book_url_relative = book.get('href')
|
||||||
if book_url_relative is not None:
|
if book_url_relative is not None:
|
||||||
book_url = urljoin(allbooks_url, book_href)
|
book_url = urljoin(allbooks_url, book_url_relative)
|
||||||
GBConvert(book_url).run()
|
GBConvert(book_url).run()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user