본문 바로가기

Python12

Qgis&Arcgis) Qgis 필드계산기 함수 사용법 D 필드에 채우기 1.C값이 "V"이면 A열 값 가져오기 2. 그외에 B열 값 가져오기 함수를 새로 생성후 def my_test (파라미터,파라미터,파라미터, feature,parent): 함수명과, 사용할 필드명갯수대로 파라미터 지정 파이썬으로 조건식 만들어 return 값 설정 만들어 놓은 함수명과 실제 (필드명을 작성) 끝 2022. 8. 27.
Python) 멀티프로세싱을 이용한 selenium 웹크롤링 # -*- coding: utf-8 -*- import sys import os import subprocess import time import multiprocessing from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.alert import Alert from selenium.webdriver.common.by import By from sel.. 2022. 2. 3.
Python) 멀티프로세싱 모듈 사용법 (Process, Pool) import multiprocessing # --- --- multiprocessing.Process 사용 def do_multi(code): # main에서 지정한 code_list의 1,2 각각 들어와서 # 두 개의 프로세스가 실행 # 여기 do_multi 함수에 멀티프로세싱으로 실행할 코드를 작성하면됨. print (code) #------------------------------------------------------------ def main(): processes = [] code_list = [1,2] for code in code_list: # 실행함수, 파라미터(복수개 가능) p = multiprocessing.Process(target = do_multi, args = [code,.. 2022. 1. 24.
selenium) 라디오버튼 값 얻기 .get_attribute # 1번 라디오버튼이 클릭 되어있는지 true or false radio_value = driver.find_element_by_xpath('xpath').get_attribute("checked") >>> print (radio_value) >>> true # value 값 얻기 radio_value = driver.find_element_by_xpath('xpath').get_attribute("value") >>> print (radio_value) >>> 1번버튼 2022. 1. 17.