Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Anibel/list parser #102

wants to merge 3 commits into from

Conversation

MariaAfanasyeva
Copy link

Описание

Сделала list-parser для anibel


closes #98

Copy link
Member

@dhvcc dhvcc left a 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__)
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По-моему эта функция уже есть, глянь в соседних файлах, может можно реюзнуть

apps/parse/anibel/list_parser/settings.py Show resolved Hide resolved
Comment on lines +1 to +5
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'
Copy link
Collaborator

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()'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тоже можно вынести в consts.py

@dhvcc
Copy link
Member

dhvcc commented Aug 12, 2021

@MariaAfanasyeva 👀

@dhvcc
Copy link
Member

dhvcc commented Aug 25, 2021

Парсить не нужно, есть доступ к АПИ
Закрою этот ПР, что бы в другом переписать

@dhvcc dhvcc closed this Aug 25, 2021
@MariaAfanasyeva MariaAfanasyeva deleted the anibel/list-parser branch August 30, 2021 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List parser для Anibel
3 participants