moonlitgrace / mangareader-api

A Python based web scraping api built with fastapi that provides easy access to manga contents

Home Page:https://mangareader-api.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refactor: use `self.parser` instead `utilities.get-*`

moonlitgrace opened this issue · comments

https://github.com/tokitou-san/MangaAPI/blob/e09ad4d36c7001a95c9ece318cb5d3c23bc6fa97/app/api/utils.py#L1-L15

Use self.parser.* instead functions from utilities.
eg: instead this code
https://github.com/tokitou-san/MangaAPI/blob/cccbcb6437861ebaf8aea7ef3d52bd00881cc3be/app/api/scrapers/popular.py#L16

Do something like ( might different for other cases )

slug = self.parser.css("div#manga-trending div.swiper-slide a.link-mask").attributes["href"] 

Lmk if you want more info or anything :)

Instead create a helper class to fix this.
Closing this*