일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 | 31 |
- next.js tailwindcss
- 안드로이드
- react 기초
- Python
- 리액트 tailwind css
- react
- mysql fix install
- next.js tailwind css
- 리액트 tailwindcss
- mysql error
- mysql
- javascript
- 도커
- mysql 삭제
- react tailwind css
- mysql purge
- Android
- 리액트 문법
- react typescript
- next.js css framework
- mysql broken install
- mysql 재설치 명령어
- Docker
- react tailwindcss
- mysql 재설치
- 리액트
- PHP
- Docker ubuntu
- 리눅스
- mysql uninstall
- Today
- Total
Developer_hong
스크린샷 저장 Chrome, Firefox 본문
# FireFox
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
ff_driver = None
# Setting ff_profile
ff_profile = webdriver.FirefoxProfile()
ff_profile.set_preference("general.useragent.override", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")
# Setting ff_options
ff_options = Options()
ff_options.add_argument("--headless")
# ff_options.add_argument( "--screenshot test.jpg http://google.com/" )
ff_url = "https://getemoji.com/"
ff_driver = webdriver.Firefox(firefox_profile=ff_profile,options=ff_options)
ff_driver.set_window_size(1000,30000)
ff_driver.get(ff_url)
ff_driver.save_screenshot('/Users/Desktop/ff_test/firefox_screen_test.png')
ff_driver.quit()
# Google Chrome
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('headless')
options.add_argument('window-size=1000x30000')
options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")
options.add_argument("disable-gpu")
options.add_argument('--no-sandbox')
driver = webdriver.Chrome('/Users/Desktop/ff_test/chromedriver',options=options)
url = "https://getemoji.com/"
driver.get(url)
driver.save_screenshot("/Users/Desktop/ff_test/chrome_screen_test.png")
'프로그래밍 > Python' 카테고리의 다른 글
Python - Mac Terminal (0) | 2020.07.10 |
---|---|
Python IDE (0) | 2020.07.10 |