-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhs_collections_organiser.py
30 lines (26 loc) · 1.03 KB
/
hs_collections_organiser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
"""
Filename: hs_collections_organiser.py
Date created: Mon Aug 24 21:06:15 2020
@author: Julio Hong
Purpose: Read wikitable to generate an Excel file
Steps:
"""
import pandas as pd
from os import path
# I thought this would be useful but actually not really. It can't even scrape all the content properly.
import wikia
from wikia import html
# To adjust the dataframe appearance
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 20)
pd.set_option('display.width', 200)
wikia.summary("Hypixel-Skyblock", "Collections")
collections_page = wikia.page("Hypixel-Skyblock", "Collections")
# I might as well scrape html using another more commonly-used lib.
html = collections_page.html()
# Each skill collection falls under table class=wikitable.
# But each item has a less consistent format.
# Kind of falls under 'tr' elem, but it's not unique to items
# Can also apply to tiers, or counts, or rewards.
# I can pull the data out. But how to organise it? That's the concern.