본문 바로가기

Ankiwoong

(1841)
[CSV]Python Study - PPT Presentation Material • CSV File? 엑셀에서 사용하는 표 형식을 텍스트 형태로 변환한 파일 즉, 데이터 구조를 표현하는 가장 간결한 형태의 파일 엑셀의 행은 한 줄로 표현하고 엑셀의 열은 콤마로 구분 # 한 반의 성적표 데이터 예시 grade = [ {'name': '노진구', 'kor': 10, 'eng': 30, 'math': 20}, {'name': '비실이', 'kor': 75, 'eng': 60, 'math': 50}, {'name': '퉁퉁이', 'kor': 13, 'eng': 55, 'math': 40} ] # 한 줄의 내용을 구성하기 위한 문자열 템플릿 word_template = '{0}, {1}, {2}, {3}\n' # CSV 파일 저장 위한 file 객체 생성 # Excel 의 CSV 경우 euc..
[Windows10]완전 종료 - 빠른 시작 종료 주 52시간이 도입되면서 바뀐것은 비단 직장인뿐만 아니다. 실무를 띄고 있는 전산직 근무자는 추가된 52시간 도입 프로그램에 온갖 머리가 다 아플지경이다. 이 52시간 프로그램이 보통 기본적으로 체크하는 시간이 CMOS에 타임을 가져가는 현상을 보인다. 이로 인해 구형 장비에 경우 52시간이 정상적으로 되지 않으면 현재 시간을 보면 시간이 틀어진 현상도 볼수 있다. 또한 Windows 종료 방식이 바뀌어 정상적으로 52시간 프로그램이 적용이 안되는 경우가 있다. 이 현상은 아래와 같이 빠른 시작 종료 즉, 완전 종료로 바꿔주면 해당 오류는 사라지는 것을 볼수 잇다.
[Selenium]Python Study - PPT Presentation Material - 3 • Headless? - 창 숨김 모드 - 윈도우 기준 크롬 59, 맥/리눅스 기준 크롬 60버전 - CLI기반의 서버 OS에서도 Selenium을 통한 크롤링 / 테스트를 가능 • Headless 사용 -선언 options.add_argument('headless') -옵션 지정 options=webdriver.ChromeOptions() driver=webdriver.Chrome('chromedriver',chrome_options=options) -> 에러 발생시 driver=webdriver.Chrome('chromedriver',options=options) from selenium import webdriver driver = webdriver.Chrome('C:\\chromedriver\\c..
[Selenium]Python Study - PPT Presentation Material - 2 • 드라이버 조작 메서드명 설명 add_cookie(cookie_dict) 쿠키 값을 딕셔너리 형식으로 지정 back()/forward() 이전 페이지 또는 다음 페이지로 이동 close() 브라우저를 닫음 current_url 현재 URL을 추출 delete_all_cookies() 모든 쿠키를 제거 delete_cookie(name) 특정 쿠키를 제거 execute(command, params) 브라우저 고유의 명령어를 실행 execute_async_script(script, *args) 비동기 처리하는 자바스크립트를 실행 execute_script(script, *args) 동기 처리하는 자바스크립트를 실행 • 드라이버 조작 메서드명 설명 save_screenshot(filename) 스크린샷을 저..
[Selenium]Python Study - PPT Presentation Material - 1 • 웹 앱을 테스트하는데 이용하는 프레임워크 • webdriver라는 API를 통해 운영체제에 설치된 Chrome등의 브라우저를 제어 • 참고 : https://sites.google.com/a/chromium.org/chromedriver/downloads Downloads - ChromeDriver - WebDriver for Chrome WebDriver for Chrome sites.google.com • 참고 : https://www.seleniumhq.org SeleniumHQ Browser Automation If you want to create robust, browser-based regression automation suites and tests, scale and distribut..
[Crawling]Python Study - PPT Presentation Material - 4 • 기본 구조(3.16.html / 3.17.html) • #아이디 이름 정의 • id=아이디 이름 • 특정한 id 속성을 가지고 있는 태그 • 참고 : https://developer.mozilla.org/en-US/docs/Web/CSS/ID_selectors ID selectors The CSS ID selector matches an element based on the value of its id attribute. In order for the element to be selected, its ID attribute must match exactly the value given in the selector. developer.mozilla.org • 기본 구조(3.18.html) • 참고 : ..
[Crawling]Python Study - PPT Presentation Material - 3 • 기본 구조(3.4.html) • 순서 없는 목록 태그 • 기본 목록을 생성할 때 사용 • 웹페이지의 네비게이션 메뉴를 생성할 때에 사용 • 참고 : https://devdocs.io/html/element/ul DevDocs devdocs.io • 참고 : https://devdocs.io/html/element/li DevDocs devdocs.io • 기본 구조(3.5.html) • 표를 생성할 때 사용 • tr : 표 내부의 행 태그 • th : 행 내부의 제목 셀 태그 / 굵은글씨 / 머리말 • td : 행 내부의 일반 셀 태그 • table 태그에 들어가는 태그 : tr, td, th, col, colgroup,row, caption, tbody, tfoot, thead, summary • ..
[Crawling]Python Study - PPT Presentation Material - 2 • 참고 : https://javaplant.tistory.com/18 HTTP 응답코드 메소드 정리 GET, POST, PUT, PATCH, DELETE, TRACE, OPTIONS HTTP Request 정보 GET /index.html HTTP/1.1 요청 URL정보 (Mehotd /URI HTTP버젼) user-agent: MSIE 6.0; Window NT 5.0 사용자 웹 브라우져 종류 accept: test/html; */* 요청 데이터 타입 (응답의 Content-ty.. javaplant.tistory.com • GET • Body 없이 Header만 전송 • 링크 / 북마크 가능 • 요청 길이 제한 존재 • 쿼리 문자열 가능 • 쿼리 문자열은 key와 value로 구분 • 쿼리는 & 로..