#-*- coding:utf-8 -*-
import threading
import requests
import time
import urllib3
import json
urllib3.disable_warnings()
def getCrawl(url):
session = requests.Session()
session.trust_env = False
session.verify = False
receive = session.get(url)
text = receive.text
# text = text.encode('utf-8')
mtext = json.dumps({"k": text})
# print(json.loads(mtext)["k"])
text = json.loads(mtext)["k"];
time.sleep(1)
print(text)
get_data = json.dumps(text, indent=4)
print(get_data)
target = "http://somesite.co.kr/uri1/uri2"
thread = threading.Thread(target=getCrawl, args=(target,))
thread.daemon = False
thread.start()
#print('Out of thread')