fix: crawl

This commit is contained in:
eneller
2025-02-25 14:09:28 +01:00
parent 4ffe110bc4
commit 55e1472e1d

View File

@@ -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()