목록Coding (143)
0w0
ref. https://pnal.kr/ http://autohotkeykr.sourceforge.net/docs/AutoHotkey.htm https://www.autohotkey.com/docs/AutoHotkey.htm http://www.autohotkey.co.kr/cgi/contents.php?id=tutorial http://www.autohotkey.co.kr/cgi/contents.php?id=commands _ 함수 및 명령 ● Autohotkey Download https://www.autohotkey.com/ ● Active Window Info - 윈도우+A키를 눌러서 출력 정보 유지 ● 노트패드 혹은 저장텍스트 파일 설정 - 스크립트가 깨질경우 해당 ahk 파일을 유니코드로 저장되..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bOPpal/btqADj5sUNT/K5uRWUkkPzkp9YkG8uTb4K/img.png)
requests를 통한 html 코드 파싱을 함수로 적용 1 2 3 4 5 6 7 8 9 10 11 12 import requests def html_parsing(url): re = requests.get(url) print(re, url) # https://naver.com print(re.content,"\n",url) #파싱된 html code return re.content url="https://naver.com" print(html_parsing(url)) ss
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bAlQ1O/btqx8p1LUhv/4LgFaSgJhpK4jtkzMp676K/img.png)
- 문제 사진을 클릭하면 파라미터의 변경을 지속 요구하는 것이 확인됨. - 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 from urllib import request as req import re, time start_time=time.time() uri="http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345" while True: html = req.urlopen(uri).read() html=str(html) if "two" in html: p = int(p) / int(..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/zsM3b/btqxZqFxKyJ/Im7mJ7OZnmIqkD2UwyUao1/img.png)
- 문제 One small letter, surrounded by EXACTLY three big bodyguards on each of its sides. 그 양쪽에 정확히 세 명의 큰 경호원들이 둘러쌓인 작은 편지 한 통. - 소스코드 내 주석 정보 확인 - 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import sys,io from urllib import request as req import re html=req.urlopen('http://www.pythonchallenge.com/pc/def/equality.html').read() html=str(html) #print(type(html)) # ori..
ref. https://selenium-python.readthedocs.io/waits.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Implicitly wait - 코드 : bs_driver.implicitly_wait(10) - 코드 설명 : 브라우저 드라이버가 페이지 호출을 10초 이내 동안 대기해주는 것 - 암시적 대기, 웹 페이지가 시간 내에 로딩되도록 대기하는 방식. - "No such Element Exception"이 발생하기 전에 웹 드라이버에게 특정 시간 동안 대기하도록 지시. Explicitly wait - from selenium.webdriver.common.by import By - from sel..
#함수 형태로 thread 적용 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 import threading import time def thread_run(): print('Thread running -Test') def thread_run_msg(msg): print('Thread running -Test',msg) start_time=time.time() for i in range(1000): t1=threading.Thread(target=thread_run) t2=threading.Thread(target=thread_run_msg,args=('service',)) t1.start() t2.start() print(time.time()-st..
보호되어 있는 글입니다.
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/c5UELK/btqxJklxKtI/thAKuX8g66YMKmFKWHlgj0/img.png)
ref. https://intellipaat.com/blog/tutorial/selenium-tutorial/selenium-cheat-sheet/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 import sys,io,time from bs4 import BeautifulSoup #requests 모듈 사용 import requests html=requests.get('https://search.naver.com/search.naver?query=날씨') soup=BeautifulSoup (html.text,'html.parser') data1 = soup.find('span',{'class':'todaytemp'}) print("현재온도:", data1.text) print("==============================") #urll..
12345678910111213141516171819202122232425262728293031323334353637383940414243#coding=utf-8 import sys, io, timeimport urllib.request as urqimport urllib.parsefrom bs4 import BeautifulSoup #--구글 html 소스 파싱html=urq.urlopen('https://www.google.com/').read() #--파싱된 소스를 BeautifulSoup 적용soup=BeautifulSoup(html,'html.parser') print("#--태그로 find_all")#모든 div 태그를 가져와 리스트 형태 저장div_all=soup.find_all('div')..