Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 봉준호감독통역사
- 어서와한국은처음이지
- 우한
- red hearse
- sharonchoi
- wuhan
- 신종코로나
- everybody wants you
- 중국외교부
- 코로나바이러스
- 최성재
- 정은경 본부장님
- 코로나19
- 봉준호감독통역
- 웨일즈
- 전염병
- 확진자수
- 창궐
- cnn
- Bolton
- 진짜영웅
- 우한코로나바이러스
- 필리핀사망
- 코로나
- parasite
- 조현병
- 치앙마이
- 미중
- 우한 코로나
- 우한코로나
Archives
- Today
- Total
오지's blog
selenium으로 크롤링시 다운로드시 특정 파일에 넣기 본문
728x90
반응형
url = 'https://www.google.com/'
chrome_options = webdriver.ChromeOptions()
prefs = {'download.default_directory': download_folder_fullpath}
chrome_options.add_experimental_option('prefs',prefs)
chrome_options.headless=True
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
driver.get(url)
위 코드에서 중요한 것은
prefs = {'download.default_directory': download_folder_fullpath}
chrome_options.add_experimental_option('prefs',prefs)
이부분이다.
pref파라미터에 다운로드 default 디렉토리 설정하고 driver설정시 chrome_option값을 넣는다.
'개발노트 > Python' 카테고리의 다른 글
ModuleNotFoundError: No module named USER_DEFINED_MODULE (0) | 2022.03.23 |
---|---|
db의 table에서 csv로 변환시 한글깨짐 현상 (0) | 2022.03.17 |
해당 폴더가 존재하지 않으면 폴더 생성 python (0) | 2022.03.08 |
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods 해결 방안 (0) | 2022.02.20 |
airflow slack fail메세지에서 log url변경하는 방법 (0) | 2022.01.24 |
Comments