-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anibel/list parser #102
Anibel/list parser #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хороший ПР, проверить нет возможности, но, надеюсь, работает 😅
|
||
from .consts import GENRES_TAG, MANGA_CARD_TAG, SOURCE_URL_TAG, THUMBNAIL_IMG_URL_TAG, TITLE_TAG | ||
|
||
logging.getLogger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это же ничего не делает
У нас management_logger
, обычный не нужен
|
||
|
||
@transaction.atomic | ||
def bulk_get_or_create(cls, names: List[str]) -> Tuple: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По-моему эта функция уже есть, глянь в соседних файлах, может можно реюзнуть
MANGA_CARD_TAG = '//div[@class = "anime-card grid-6 top-05"]' | ||
TITLE_TAG = "//h1//a/text()" | ||
SOURCE_URL_TAG = "//h1//a/@href" | ||
GENRES_TAG = '//div[@class = "tags"]//a/text()' | ||
THUMBNAIL_IMG_URL_TAG = '//div[contains(@class, "grid-4 left")]//img/@data-src' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что-то мне кажется, что разметка сайта поменялась, потому что эти XPATH не работают.
У них есть сейчас сайт old.anibel.net и там работает
return | ||
mangas_list = mangas_list.text | ||
|
||
xpath_selector = '//li[@class = "page-item-num"]//a[@class = "page-link"]/text()' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это тоже можно вынести в consts.py
Парсить не нужно, есть доступ к АПИ |
Описание
Сделала list-parser для anibel
closes #98