| @@ -15,6 +15,7 @@ def get_title(url): | |||||
| title = code | title = code | ||||
| title = title[:-18] | title = title[:-18] | ||||
| return title | return title | ||||
| def get_img(url): | def get_img(url): | ||||
| fp = urllib.request.urlopen(url) | fp = urllib.request.urlopen(url) | ||||
| mybytes = fp.read() | mybytes = fp.read() | ||||
| @@ -37,6 +38,15 @@ def get_author(url): | |||||
| author = str(dict).split('"')[4][1:][:-4] | author = str(dict).split('"')[4][1:][:-4] | ||||
| return author | return author | ||||
| def get_status(url): | |||||
| fp = urllib.request.urlopen(url) | |||||
| mybytes = fp.read() | |||||
| html = mybytes.decode("utf8") | |||||
| fp.close() | |||||
| soup = BeautifulSoup(html, "html5lib") | |||||
| status = soup.find_all("div", class_="row m-0 py-1 px-0 border-top") | |||||
| print(str(status)) | |||||
| def get_id(url): | def get_id(url): | ||||
| id = url.split('/')[4] | id = url.split('/')[4] | ||||
| @@ -61,19 +71,20 @@ def get_last_chap(url): | |||||
| def main(): | def main(): | ||||
| url = "https://mangadex.org/title/31477" | url = "https://mangadex.org/title/31477" | ||||
| title = get_title(url) | |||||
| print("Titre de l'anime : %s " % title) | |||||
| author = get_author(url) | |||||
| print("Auteur de l'anime : %s " % author) | |||||
| id = get_id(url) | |||||
| print("ID Mangadex : %s " % id) | |||||
| chap = get_last_chap(url) | |||||
| print("Dernier chap : %s " % chap) | |||||
| link = get_url(get_id(url)) | |||||
| print("Url mangadex : %s" % link) | |||||
| print("Image : %s" % get_img(url)) | |||||
| # title = get_title(url) | |||||
| # print("Titre de l'anime : %s " % title) | |||||
| # author = get_author(url) | |||||
| # print("Auteur de l'anime : %s " % author) | |||||
| # id = get_id(url) | |||||
| # print("ID Mangadex : %s " % id) | |||||
| # chap = get_last_chap(url) | |||||
| # print("Dernier chap : %s " % chap) | |||||
| # link = get_url(get_id(url)) | |||||
| # print("Url mangadex : %s" % link) | |||||
| # img = get_img(url) | |||||
| # print("Image : %s" % img) | |||||
| status = get_status(url) | |||||
| print("Status : %s" % status) | |||||
| if __name__ == '__main__': | if __name__ == '__main__': | ||||
| main() | main() | ||||