Skip to content

Instantly share code, notes, and snippets.

View hyunsikhwang's full-sized avatar

Hyunsik hyunsikhwang

  • Korea
View GitHub Profile
@hyunsikhwang
hyunsikhwang / ext_KCD.py
Created July 12, 2021 08:06
#KCD #code #extract #range #comma
def ext_KCD(df_KCD, input_KCD):
KCD_1 = input_KCD.replace(' ', '').split(',')
KCD_list = []
for KCD in KCD_1:
if "-" in KCD:
KCD_beg = KCD.split('-')[0].upper()
KCD_end = KCD.split('-')[1].upper()
@hyunsikhwang
hyunsikhwang / colabchecker.py
Created March 14, 2021 06:28
Check running on Google Colab
if 'google.colab' in str(get_ipython()):
print('Running on CoLab')
else:
print('Not running on CoLab')
@hyunsikhwang
hyunsikhwang / bloomberg-billionaires-index.ipynb
Created February 13, 2021 12:00
Bloomberg Billionaires Index.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hyunsikhwang
hyunsikhwang / bad_bond.py
Created February 4, 2018 13:04
bad_bond.py
import bs4, requests
import urllib.request
import json
import console
import socket
def get_beautiful_soup(url):
return bs4.BeautifulSoup(requests.get(url).text, "html5lib")
javascript: var authURL = 'http://first.wifi.olleh.com/starbucks/index_kr.html'; switch (window.location.href) { case authURL: document.getElementById("agreement_agree").checked = true; document.getElementById("purpose_agree").checked = true; goAct(); break; default: window.location.href = authURL; }
import sys
print('Number of arguments: ', len(sys.argv), 'arguments.')
print('Argument List: ', str(sys.argv))
print(str(sys.argv[1]))
print(str(sys.argv[2]))
@hyunsikhwang
hyunsikhwang / bad_bond.py
Created September 10, 2017 11:44
bad_bond.py
import bs4, requests
import urllib.request
import json
import console
def get_beautiful_soup(url):
return bs4.BeautifulSoup(requests.get(url).text, "html5lib")
def bad_rooffunding():
@hyunsikhwang
hyunsikhwang / funda.py
Last active August 16, 2017 00:19
P2P 투자 펀다 사이트에서 투자정보를 파싱하는 방법
import bs4, requests
def get_beautiful_soup(url):
return bs4.BeautifulSoup(requests.get(url).text, "html5lib")
soup = get_beautiful_soup('https://www.funda.kr/v2/investment')
#print(soup.prettify())
pkg_list = soup.find_all("div", "merchandise_inner_box")
pkg_details = soup.find_all("div", "merchandise_details")
progress = soup.find_all("div", "merchandise_progress_bar")
@hyunsikhwang
hyunsikhwang / kofiabond.py
Last active August 16, 2017 00:18
kofiabond 사이트에서 채권 정보를 가져오는 방법입니다.
# -*- coding: utf-8 -*-
import requests
import bs4
import xml.etree.ElementTree as ET
def get_beautiful_soup(url):
return bs4.BeautifulSoup(requests.post(url, data=xml, headers=headers).text, "html5lib")
def get_date(url):
return bs4.BeautifulSoup(requests.get(url).text, "html5lib")
@hyunsikhwang
hyunsikhwang / KRX.py
Last active August 16, 2017 00:17
KRX 시장 통계 데이터를 가져오는 방법입니다.
# -*- coding: utf-8 -*-
import requests
import bs4
import xml.etree
import datetime
def post_beautiful_soup(url):
return bs4.BeautifulSoup(requests.post(url, data=payload).text, "html5lib")
def get_beautiful_soup(url):