본문 바로가기
반응형
글쓰기

Python6

[python] Selenium 활용 예스24 티켓예매 매크로 만들기 Selenium 활용 Yes24 티켓 예매 매크로 만들기(*selenium 연습용으로 사용할 것) 1. 패키지 설치pip install selenium 2. 모듈 importfrom selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import Select import time 3. 웹 드라이버 설정 웹드라이버를 설정해준 뒤, yes24 티켓예매 페이지를 받아온다# 브라우저 꺼짐 방지 옵션.. 2024. 5. 28.
[python] 파이썬 클래스 개념 (__init__, self) 클래스 (Class): 동작(behavior, method, function)과 상태(state, attribute, variable)의 묶음   → 객체를 찍어내기 위한 설계도  클래스 만들기# 클래스class Person : def setdata(self, name, age): self.name = name self.age = age         # 객체 생성 p1 = Person() p1.setdata('spectrum',20)  클래스에 메소드 추가하기class Person : def setdata(self, name, age): self.name = name self.age = age         def walk(self): print('뚜벅뚜벅') def talk(self).. 2024. 5. 19.
[python] Selenium IE 에서 시작하기 (+Internet Explore) IE에서 Seleniu을 시작해보자 (그만해보자... 오랜만에 코드를 실행해보니, 작동이 안됨)  먼저, IE 드라이버 설치https://www.selenium.dev/downloads/ DownloadsSelenium automates browsers. That's it!www.selenium.dev다운로드 후, 압축을 풀어준다   코드from selenium import webdriverfrom selenium.webdriver.ie import serviceimport timegoogle= 'https://www.google.com'ie_options = webdriver.IeOptions()ie_options.ignore_protected_momde_settings = Trues=service.S.. 2023. 11. 4.
[python] Selenium chrome에서 시작하기 (+ 크롬 브라우저, element, driver, alert 다루기) Selenium 프레임워크 활용 자동화 매크로를 만들어보았다  ***  Selenium 4버전 이상에서는 크롬 드라이버를 따로 설치하지 않아도 된다!크롬드라이버 설치크롬 브라우저를 사용할거라 내 컴퓨터의 크롬 버전에 맞는 크롬드라이버를 설치해준다크롬 버전 확인은 크롬브라우저 창 오른쪽 맨 끝 점 세 개 → 도움말 → Chrome 정보에 들어가서 확인할 수 있다 아래 사이트에서 내 크롬브라우저 버전에 맞는 크롬드라이버를 설치한다https://chromedriver.chromium.org/downloads ChromeDriver - WebDriver for Chrome - DownloadsCurrent Releases If you are using Chrome version 115 or newer, plea.. 2023. 10. 15.
[python] Selenium (+ 엣지 브라우저) ↓ 크롬브라우저는 아래 링크 [python] Selenium (+ 크롬 브라우저) (tistory.com) [python] Selenium (+ 크롬 브라우저) Selenium 프레임워크 활용 자동화 매크로를 만들어보았다 *** Selenium 4버전 이상에서는 크롬 드라이버를 따로 설치하지 않아도 된다! 크롬드라이버 설치 크롬 브라우저를 사용할거라 내 컴퓨터의 spectrum20.tistory.com Selenium 프레임워크 활용 자동화 매크로를 만들어보았다 엣지 드라이버 설치 내 컴퓨터의 크롬 버전에 맞는 엣지드라이버를 설치해준다 엣지 버전 확인은 엣지 브라우저 창 오른쪽 맨 끝 점 세 개 → 설정 → Microsoft Edge 정보에 들어가서 확인할 수 있다 (나는 버전 107.0.1418.62 .. 2023. 10. 15.
[python] 파이썬 패키지 오프라인 설치 (수동 설치) offline 또는 폐쇄망 환경에서는 pip로 외부 패키지를 받아올 수 없다이럴 때, 수동으로 설치하는 두 가지 방법이 있다(두번째 방법을 추천★)   먼저, 첫 번째 방법● pypi 사이트에서 패키지 파일 직접 다운받기아래 사이트에 접속해서, 설치하고자 하는 패키지 검색 후 다운로드한다 https://pypi.org/ PyPI · The Python Package IndexThe Python Package Index (PyPI) is a repository of software for the Python programming language.pypi.org왼쪽에 Download files 클릭하면 tar 파일과 whl 파일을 다운로드 할 수 있다Windows 환경에 설치할 whl 파일을 다운로드 해준다.. 2023. 9. 17.
반응형