728x90 ๐จ๐ผ๐ป๊ฐ๋ฐ158 ์ ๋ ๋์ - ์ด๋ฏธ์ง(img) ๋ค์ด๋ก๋ (No urllib.urlretrieve) URL ์์ฒญ ๋ฐฉ์์ธ urllib.urlretrieve์ src ์ฃผ์๋ก ์์ฒญ์ ํ๋ ๋ฐฉ์์ด๊ธฐ ๋๋ฌธ์ ์บก์ฑ (์๋๋ฑ๋ก๋ฐฉ์ง ๋ฌธ์)์ฒ๋ผ ๋งค๋ฒ ์์ฒญํ ๋๋ง๋ค ์ด๋ฏธ์ง๊ฐ ๋ฐ๋๋ ๊ฒฝ์ฐ๊ฐ ์์ด ๋ฌด์ฉ์ง๋ฌผ์ด ๋๋ค. ๊ทธ๋ฌ๋ฏ๋ก ์ด๋ฏธ ๋ธ๋ผ์ฐ์ ์ ๋ก๋๊ฐ ๋ ์ด๋ฏธ์ง๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ ์ฌ์ฉํด์ผ ํ๋ค. ๋ฐฉ๋ฒ 1. screenshot_as_png ์ฌ์ฉ (์ถ์ฒ) from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www.webpagetest.org/') with open('filename.png', 'wb') as file: file.write(driver.find_element_by_xpath('/html/body/div[1]/div[5]/div[2.. 2023. 2. 28. ํ์ด์ฌ - ์ธ์ ๋ง๋ฃ ์๊ฐ ๊ฒ์ฆํ๊ธฐ from datetime import timedelta, datetime session_lifetime = timedelta(seconds=10) # ์ธ์ ์ ์ง ์๊ฐ expired_time = datetime.now() + session_lifetime if expired_time < datetime.now(): print("์ธ์ ์ฌ์ฉ ๊ธฐ๊ฐ์ด ๋ง๋ฃ๋จ.") 2023. 2. 3. ํ์ด์ฌ - ํ์ฉ๋ ๋ฌธ์, ์ฌ์ฉ ๊ฐ๋ฅํ ๋น๋ฐ๋ฒํธ ๋ฌธ์๋ค์ธ์ง ๊ฒ์ฆํ๊ธฐ (re) ์๋ฌธ, ์ซ์, ํน์ ๋ฌธ์๋ค๋ก ๊ตฌ์ฑ๋ ๋น๋ฐ๋ฒํธ์ธ์ง ํ์ธํ๊ธฐ import re password = raw_input("Enter string to test: ") if re.fullmatch(r'[A-Za-z0-9!@#$%^&+=]{8,}', password): # match else: # no match ์ถ์ฒ: https://stackoverflow.com/questions/2990654/how-to-test-a-regex-password-in-python How to test a regex password in Python? Using a regex in Python, how can I verify that a user's password is: At least 8 characters Must be re.. 2023. 2. 3. Flask - ํ์ด์ฌ flask ๊ฐ๋จํ ์บก์ฑ ์์ (flask-simple-captcha) ๋ชจ๋ ์ค์น pip install flask-simple-captcha simple_captcha_example.py from flask import Flask, render_template, request from flask_simple_captcha import CAPTCHA config = { 'SECRET_CAPTCHA_KEY': '1111111111111111111111111', 'METHOD': 'pbkdf2:sha256:100', 'CAPTCHA_LENGTH': 5, 'CAPTCHA_DIGITS': False } @app.route('/example', methods=['GET','POST']) def example(): if request.method == 'GET': captcha = CA.. 2023. 2. 2. C# - ์ค์ ๊ฐ ๋ฐฐ์ด(array) ํํ๋ก ์ ์ฅํ๊ณ ๋ถ๋ฌ์ค๊ธฐ ์ ์ฅํ๊ธฐ string value = String.Join(",", intArray.Select(i => i.ToString()).ToArray()); Properties.Settings.Default.option_array = value; Properties.Settings.Default.Save(); ๋ถ๋ฌ์ค๊ธฐ int[] arr = Properties.Settings.Default.option_array.Split(',').Select(s => Int32.Parse(s)).ToArray(); ์ถ์ฒ: https://stackoverflow.com/questions/1766610/how-to-store-int-array-in-application-settings How to store int[] array .. 2023. 2. 1. C# - dataGridView1 ์ ๊ฐ ์์ ํ๊ธฐ dataGridView1[1,1].Value="tes"; ์ถ์ฒ: https://stackoverflow.com/questions/1516252/how-to-programmatically-set-cell-value-in-datagridview How to programmatically set cell value in DataGridView? I have a DataGridView. Some of the cells receive their data from a serial port: I want to shove the data into the cell, and have it update the underlying bound object. I'm trying something like th... stackov.. 2023. 2. 1. ์ ๋ ๋์ - ํ์ด์ฌ ๋ด ๊ฐ์ง ์ฐํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(undetected-chromdriver) pypi https://pypi.org/project/undetected-chromedriver/ undetected-chromedriver ('Selenium.webdriver.Chrome replacement with compatiblity for Brave, and other Chromium based browsers.', 'Not triggered by CloudFlare/Imperva/hCaptcha and such.', 'NOTE: results may vary due to many factors. No guarantees are given, except for ongoing eff pypi.org ์ค์น pip install undetected-chromedriver ์ฌ์ฉ ์์ import u.. 2023. 1. 29. C# - ๋ง์ดํฌ๋ก์ํํธ ๊ณต์ UWP, WPF ์์ต์ (GUI ํ๋ก๊ทธ๋๋ฐ) ๋ฐ ๋์ ์ฐจ์ด์ UWP ์์ต์ https://learn.microsoft.com/ko-kr/visualstudio/get-started/csharp/tutorial-uwp?view=vs-2022 ์์ต์: Visual Studio ๋ฐ C#์ ์ฌ์ฉํ์ฌ UWP ์ฑ ๋ง๋ค๊ธฐ Visual Studio์์ XAML ๋ฐ C#์ ์ฌ์ฉํ์ฌ UWP ์ฑ ๋ง๋ค๊ธฐ learn.microsoft.com WPF ์์ต์ https://learn.microsoft.com/ko-kr/visualstudio/get-started/csharp/tutorial-wpf?view=vs-2022 C#์์ WPF๋ฅผ ์ฌ์ฉํ๋ Hello World ์ฑ - Visual Studio (Windows) WPF(Windows Presentation Foundation) UI ํ.. 2023. 1. 19. OpenCV - ํ์ด์ฌ cv2 ์ด๋ฏธ์ง ์์ ํน์ ์ด๋ฏธ์ง ๊ฐ์งํ๊ธฐ def isExistImage(a, b, c=0.65): print("์ด๋ฏธ์ง ์กด์ฌ ์ฌ๋ถ") img_rgb = cv2.imread(a) template = cv2.imread(b) h, w = template.shape[:-1] res = cv2.matchTemplate(img_rgb, template, cv2.TM_CCOEFF_NORMED) threshold = c loc = np.where(res >= threshold) return len( loc[0] ) != 0 print(isExistImage("screen.png", "target.png")) # True or False def getMatchPosition(a, b, c=0.65): print("์ด๋ฏธ์ง ์์น ๊ฐ์ ธ์ค๊ธฐ") img_rgb = cv.. 2023. 1. 16. ์ ๋ ๋์ - ๋ธ๋ผ์ฐ์ ์ฐฝ ์์น ์๋ณด์ด๋ ๊ณณ์ผ๋ก ์ด๋ var options = new ChromeOptions(); options.AddArgument("--window-position=-32000,-32000"); var chromeDriverService = ChromeDriverService.CreateDefaultService(); chromeDriverService.HideCommandPromptWindow = true; driver = new ChromeDriver(chromeDriverService, options); 2022. 12. 19. ์ ๋ ๋์ - ํฌ๋ก๋ฏธ์ ์๋ ๋ฒ์ ๋ค ๋ค์ด๋ก๋ https://vikyd.github.io/download-chromium-history-version/#/ Chromium History Versions Download ↓ vikyd.github.io 2022. 12. 7. ์ ๋ ๋์ - alert, confirm ์์ ์ฐจ๋จ ํ์ฅ ๋๊ตฌ https://chrome.google.com/webstore/detail/alert-control/ofjjanaennfbgpccfpbghnmblpdblbef Alert Control Control browser alert windows. Block by default or on specific websites. chrome.google.com ๊ฐ๋ alert์ด ๋จ๋ฉด ์ ๋ ๋์์ด ์์ ์กฐ์์ด ์๋๋ ๊ฒฝ์ฐ๊ฐ ์๋๋ฐ, ์ด ํ์ฅ ๋๊ตฌ๋ฅผ ์ค์นํด์ฃผ๋ฉด alert์ด ์์ ๋์ค์ง ์๋๋ค. 2022. 11. 30. ์ด์ 1 2 3 4 5 6 7 ยทยทยท 14 ๋ค์ 728x90