def search_and_download(search_term:str,driver_path:str,target_path='./images'):
with webdriver.Chrome(executable_path=driver_path) as wd:
res = fetch_image_urls(search_term, number_images, wd=wd, sleep_between_interactions=0.5)
위가 함수 내용
메인에서 이 함수 호출부는
DRIVER_PATH = "C:\chromedriver"
search_term = '테스트'
search_and_download(search_term=search_term, driver_path=DRIVER_PATH)
이렇게 되는데 아래와 같은 오류를 뱉네요
with webdriver.Chrome(executable_path=driver_path) as wd:
AttributeError: __enter__
https://stackoverflow.com/questions/51427729/python-error-attributeerror-enter
여기에 답변이 달려있긴 한데, 제 문제를 해결할 수 있는 답변은 아닌 것 같아 질문을 올려봅니다
파일이름 주소에 추가
오우솃 감사합니다 형님