################################################################################################# # ¹èÄ¡ start ##################################################################################### from tkinter import * # ¹èÄ¡ place ### # win = Tk() # win.geometry("500x300") # win.title("pack") # win.option_add("*Font","±Ã¼­ 20") # # # ¹èÄ¡ grid ### # btn = Button(win) # btn.config(text='new') # btn.place(x=10, y=10) # # btn2 = Button(win) # btn2.config(text='new2') # btn2.place(x=100, y=100) # # # btn3 = Button(win) # btn3.config(text='new') # btn3.place(relx=0.5, rely=0.5) # # btn4 = Button(win) # btn4.config(text='new2') # btn4.place(x=0.8, rely=0.8) # ¹èÄ¡ place ### # ¹èÄ¡ grid ### # btn_list = [] # col_num =4 # row_num =3 # # for j in range(0,row_num): # for i in range(0,col_num): # btn = Button(win) # btn.config(text='({},{})'.format(i,j), padx=10) # btn.grid(column=i, row=j, padx=10, pady=10) # btn_list.append(btn) # # btn = Button(win) # btn.config(text='new',width=5, height=4) # btn.grid(column=3, row=0, rowspan=2) # # btn2 = Button(win) # btn2.config(text='new2') # btn2.grid(column=1, row=2, columnspan=2) # ¹èÄ¡ grid ### # ¹èÄ¡ pack ### # ent=Entry(win) # ent.pack(side='top') # # btn = Button(win) # btn.config(text='button') # def aa(): # btn.pack(pady=ent.get()) # # btn.config(command=aa) # btn.pack() # # btn2 = Button(win) # btn2.config(text='temp') # btn2.pack() # ¹èÄ¡ pack ### win.mainloop() # ¹èÄ¡ end ##################################################################################### # ¹öư ÀÔ·ÂÆû ¿¬µ¿ Å©·Ñ¸µ start #################################################################### from tkinter import * from datetime import datetime from bs4 import BeautifulSoup import requests win=Tk() win.geometry("600x100") win.title('Å×½ºÆ® GUI') win.option_add("*Font","±Ã¼­ 20") def lotto_p(): n=ent.get() url = "https://dhlottery.co.kr/gameResult.do?method=byWin&drwNo={}".format(n) req = requests.get(url) soup = BeautifulSoup(req.text, "html.parser") txt=soup.find("div", attrs={"class","win_result"}).get_text() title = txt.split("\n")[1:3] numlist = txt.split("\n")[7:13] bonus = txt.split("\n")[-4] print(title) print(numlist) print(bonus) btn = Button(win) btn.config(text='·Î¶Ç´ç÷¹øÈ£ È®ÀÎ') #btn.config(width=10, height=1) btn.config(command=lotto_p) btn.pack() ent=Entry(win) ent.pack() win.mainloop() # ¹öư ÀÔ·ÂÆû ¿¬µ¿ Å©·Ñ¸µ end #################################################################### # ·Î±×ÀÎÆû ºê¶ó¿ìÀú µ¥ÀÌÅÍ Àü¼Û ÀÚµ¿·Î±×ÀÎ start##################################################### from tkinter import * from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service as ChromeService from selenium.webdriver.chrome.options import Options as ChromeOptions from webdriver_manager.chrome import ChromeDriverManager # id pw log.login win=Tk() win.geometry("400x300") win.title('´ÙÀ½·Î±×ÀÎ') win.option_add("*Font","±Ã¼­ 20") btn = Button(win) #·Î°í lab_logo = Label(win) img = PhotoImage(file="./google.png", master=win) img = img.subsample(2) lab_logo.config(image=img) lab_logo.pack() #id ¶óº§ lab1 = Label(win) lab1.config(text="¾ÆÀ̵ð") lab1.pack() #pw ÀÔ·Ââ ent1 = Entry(win) ent1.insert(0,"test@test.com") def clear(event): if ent1.get() == "test@test.com": ent1.delete(0, len(ent1.get())) ent1.bind("", clear) ent1.pack() #pw ¶óº§ lab2 = Label(win) lab2.config(text="ºñ¹Ð¹øÈ£") lab2.pack() #pw ÀÔ·Ââ ent2 = Entry(win) ent2.config(show="*") ent2.pack() #·Î±×Àιöư btn = Button(win) btn.config(text='·Î±×ÀÎ') def login(): my_id = ent1.get() my_pass = ent2.get() options = ChromeOptions() user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" options.add_argument('user-agent=' + user_agent) options.add_argument("lang=ko_KR") options.add_argument('window-size=1920x1080') options.add_argument("disable-gpu") options.add_experimental_option("detach", True) service = ChromeService(executable_path=ChromeDriverManager().install()) driver = webdriver.Chrome(service=service, options=options) url = "https://accounts.kakao.com/login/?continue=https%3A%2F%2Flogins.daum.net%2Faccounts%2Fksso.do%3Frescue%3Dtrue%26url%3Dhttps%253A%252F%252Fwww.daum.net#login" driver.get(url) driver.implicitly_wait(5) xpath1 = "//input[@name='loginId']" driver.find_element(By.XPATH, xpath1).send_keys(my_id) driver.implicitly_wait(5) xpath2 = "//input[@name='password']" driver.find_element(By.XPATH, xpath2).send_keys(my_pass) driver.implicitly_wait(5) xpath3 = "//button[@class='btn_g highlight submit']" driver.find_element(By.XPATH, xpath3).click() lab3.config(text='[¸Þ¼¼Áö]·Î±×Àμº°ø') btn.config(command=login) btn.pack() #¸Þ¼¼Áö¶óº§ lab3 = Label(win) lab3.pack() win.mainloop() # ·Î±×ÀÎÆû ºê¶ó¿ìÀú µ¥ÀÌÅÍ Àü¼Û ÀÚµ¿·Î±×ÀÎ end#######################################################