본문 바로가기

Python

(7)
Appium - App Open 진짜 오래 걸렸다. Pycharm 설정부터 App Open 명령어까지... 일단 제일 헤맸던 파이참 설정부터 복기해 보자 1. File > Setting > 자신의 프로젝트 이름 Tap 선택 2. Python Interpreter > + 버튼 선택 > appium python-client 설치 3. Pycharm 재부팅 (재부팅 안 했더니 드라이버가 안 잡혔다.) 4. 실단말 컴퓨터에 연결 (개발자 모드 USB 디버깅 체크) 5. Pycharm 명령어 입력 from appium import webdriver #webdriver 호출 desired_cap = { "appium:deviceName" : "273344584e217ece", # 단말명 (cmd > adb devices) "platformName..
Python Selenium 무한스크롤 웹 크롤링을 하다보면 맨 아래까지 스크롤해야 원하는 정보를 얻는 경우가 많다. # 스크롤 전 높이 before_h = driver.execute_script("return window.scrollY") # 무한 스크롤 while True: # 맨 아래로 스크롤을 내린다. driver.find_element(By.CSS_SELECTOR, 'body').send_keys(Keys.END) # 스크롤 사이 페이지 로딩 시간 time.sleep(1) # 스크롤 후 높이 after_h = driver.execute_script("return window.scrollY") if after_h == before_h: break before_h = after_h 이 코드는 신이고 나는 무적이다. 까먹기 싫어서 보관해두자.
Python Selenium with 원티드(1) 오늘은 원티드 스크래핑 도전. 최근 친구의 이직 성공으로 인한 단기자극으로 구직사이트를 방문하는 일이 많아졌다. 생각도 났고 시간도 난김에 한번 긁어보자. from selenium import webdriver #브라우저 꺼짐 방지 옵션 from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as E..
Appium - 설치(1) Selenium 하다보니 (잘하는것아님) 어떻게하다 Appium을 듣게되었다. 아직까지도 뭔지는 모른다. 물어물어 다운로드 시작 또 까먹을 나를 위해 과정을 적어두겠다. 1. Python 설치 https://www.python.org/downloads/windows/ Python Releases for Windows The official home of the Python Programming Language www.python.org 2. PyCharm 설치 왜 VS Code를 안쓰는지는 정확히 모름 (편하고 좋다더라.. 정도) https://www.jetbrains.com/ko-kr/pycharm/download/#section=windows PyCharm 다운로드: JetBrains가 만든 전문 개..
Python Selenium with 네이버쇼핑(2) 어제시도한 코드는 버리고 유튜브를 참고하기로.. from selenium import webdriver #브라우저 꺼짐 방지 옵션 from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time import csv # 브라우저 꺼짐 방지 옵션 chrome_options = Op..
Python Selenium with 네이버쇼핑 오전동안 끄적여봤다. 마침 면도기도 필요했고 필터 선택과 상품명, 가격, 링크 추출까진 성공 Excel 파일로 추출하는건 오후 업무가 생겨서 Pass from selenium import webdriver #브라우저 꺼짐 방지 옵션 from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By # 브라우저 꺼짐 방지 옵션 chrome_options = Options() chrome_options.add_experimental_option("detach", True) driver = webdriver.Chrom..
Python Selenium 맛보기 with Valorant 처음 Selenium 만져본날이다. 자축을 위한 기념사진 from selenium import webdriver #브라우저 꺼짐 방지 옵션 from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By # 브라우저 꺼짐 방지 옵션 chrome_options = Options() chrome_options.add_experimental_option("detach", True) driver = webdriver.Chrome(options=chrome_options) # URL 열기 driver.get("https..