Private Sub Inject_Alert_Blocker()
Dim head As HtmlElement = WebBrowser1.Document.GetElementsByTagName("head")(0)
Dim script_element As HtmlElement = WebBrowser1.Document.CreateElement("script")
Dim alert_blocker As String = "###"
script_element.SetAttribute("text", alert_blocker)
head.AppendChild(script_element)
End Sub
Private Sub WebBrowser1_Navigated(sender As Object, e As WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
Inject_Alert_Blocker()
End Sub
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
WebBrowser1.Document.parentWindow.execScript "window.confirm=function(){return true;}", "JavaScript"
WebBrowser1.Document.parentWindow.execScript "window.alert=function(){return true}", "JavaScript"
WebBrowser1.Document.parentWindow.execScript "window.close=function(){}", "JavaScript"
End Sub
from urllib.request import urlopen
import json
order_currency = "BTC" # 검색 화폐
payment_currency = "KRW"
BASE_URL = "https://api.bithumb.com/public/ticker/{}_{}".format(order_currency, payment_currency)
response = urlopen(BASE_URL).read().decode('utf-8')
responseJson = json.loads(response)
print(responseJson.get("status")) # 결과 상태 코드 (정상: 0000, 그 외 에러 코드 참조)
print(responseJson.get("data").get("opening_price")) # 시가 00시 기준
print(responseJson.get("data").get("closing_price")) # 종가 00시 기준