Exemplo n.º 1
0
archive = jikan.season_archive()
pprint(archive)

later = jikan.season_later()
pprint(later)

monday = jikan.schedule(day='monday')
pprint(monday)

top_anime = jikan.top(type='anime')
pprint(top_anime)

action = jikan.genre(type='anime', genre_id=1)
pprint(action)

deen = jikan.producer(producer_id=37)
pprint(deen)

jump = jikan.magazine(magazine_id=83)
pprint(jump)

nekomata1037 = jikan.user(username='******')
pprint(nekomata1037)

fantasy_anime_league = jikan.club(379)
pprint(fantasy_anime_league)

meta = jikan.meta(request='requests', type='anime', period='today')
pprint(meta)
# grab links from the MAL club to attach to mnu ids
# need to use selenium here since external links arent scrapable

import os
import json
from jikanpy import Jikan
from time import sleep
from selenium import webdriver

this_dir = os.path.dirname(os.path.abspath(__file__))

j = Jikan("http://localhost:8000/v3/")
relations = j.club(72940)["anime_relations"]


# get credentials from file
with open("credentials.json", "r") as f:
    creds = json.load(f)
    username, password = creds["username"], creds["password"]


# create webdriver
driver = webdriver.Chrome()


# Login
driver.get("https://myanimelist.net/login.php")
# driver.find_element_by_css_selector(".modal-container button").click()  # accept privacy policy changes for this session
driver.find_element_by_id("loginUserName").send_keys(username)
driver.find_element_by_id("login-password").send_keys(password)
driver.find_element_by_css_selector(