TypeError: 'module' object is not callable
TypeError: 'module' object is not callable 해결하기
오류코드 #ExceptionExample2.py import MyError def say_nick(nick): if nick == '바보': raise MyError() print(nick, "from Example2") try: # say_nick('천사') say_nick('바보') except MyError: print("허용되지 않는 별명입니다.") # MyError.py
iksflow.tistory.com
tqdm 사용법 - python 진행률 프로세스바
파이썬으로 어떤 작업을 수행중인데, 프로그램이 내가 의도한 데로 돌아가고 있는 중인가, 진행상황이 궁금할 때가 있다. 시간이 걸리는 작업의 경우에 더 이런 상태 확인이 필요하다. 파이썬
skillmemory.tistory.com
파이썬 반복문, for문 문법과 활용 팁 알아보기
파이썬에는 while문과 for문 2개의 반복문이 있다. 그 중 가장 많이 사용하는 것은 for문이 아닌가 싶다. 반복작업을 매번 하지 않고, 컴퓨터가 해주는 것은 정말 편리하다. for문의 문법은 언어마다
aplab.tistory.com
from selenium.webdriver.common.by import By
from selenium import webdriver # 셀레니움
driver = webdriver.Chrome()
url = 'https://www.glassdoor.com/Job/index.htm'
driver.get(url)
search_box = driver.find_element(By.XPATH,'//*[@id="searchBar-jobTitle"]')
search_box.send_keys("Data Analyst")
# 검색 버튼 클릭
search_box.submit()
result_df = pd.DataFrame()
def find_text_list(url):
text_list = driver.find_elements(By.XPATH, url)
return [i.text for i in text_list]
# def find_click(url):
# element=driver.find_elements(By.XPATH, url)
# for i in element:
# i.click()
for i in tqdm(range(5)):
time.sleep(3)
i=1
#1페이지 클릭
driver.find_element(By.XPATH, '//*[@id="left-column"]/div[2]/ul/li['+str(i)+']/div').click()
title = find_text_list('//*[@id="app-navigation"]/div[3]/div[2]/div[2]/div/div[1]/header')
tmp = pd.DataFrame()
tmp['title'] = title
result_df = pd.concat([result_df, tmp])
i+=1
time.sleep(2)
# time.sleep(2)
# # driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
# time.sleep(2)
# #팝업 x버튼
# driver.find_element(By.XPATH, '/html/body/div[11]/div[2]/div[2]/div[1]/button').click()
li 넘어가지 않는 문제
질문.
클릭시 페이지가 바뀔 수도 있고 경우의 수가 많다.
[파이썬 셀레니움 기초] 팝업창 닫는 방법
웹 스크래핑을 하다보면 사이트에 따라 아래와 같이 여러개의 팝업창이 뜨는 경우가 있는데요. 이때 팝업창들을 닫기 위해서는 어떻게 해야 할까요? 1) url접속 코드 작성 from selenium import webdriver
yeko90.tistory.com
[시계열 데이터수집] 크롤링 다음페이지 넘기기
예전에 프로젝트를 하다가 전염병 관련 데이터를 모았던 일이 있습니다. url 이 변하지 않아 selenium을 써야 했고 직접 한페이지 한페이지 넘기면서 데이터를 가져왔어야 했습니다. 다음페이지 버
sequence-data.tistory.com
다른 모듈.. 시도..
크롬 드라이버 다운그레이드 how
ChromeDriver - WebDriver for Chrome - Downloads
Current Releases If you are using Chrome version 115 or newer, please consult the Chrome for Testing availability dashboard. This page provides convenient JSON endpoints for specific ChromeDriver version downloading. For older versions of Chrome, please se
chromedriver.chromium.org
Chrome(크롬) 강제업데이트 차단
# 자동업데이트 중지 크롬의 업데이트 확인 간격을 0으로 설정 defaults write com.google.Keystone.Agent checkInterval 0 # 자동업데이트 실행 크롬 업데이트 확인 간격을 기본값 18000 으로 설정 defaults write com.go
wonyoung2.tistory.com
240402수_TIL (0) | 2024.04.02 |
---|---|
240401월_TIL (0) | 2024.04.01 |
240328목_TIL (0) | 2024.03.28 |
240327수_TIL (1) | 2024.03.27 |
240326화_TIL (0) | 2024.03.26 |