일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- javascript
- 안드로이드
- mysql purge
- 리눅스
- 리액트
- 리액트 tailwind css
- mysql
- mysql error
- mysql 재설치 명령어
- Docker ubuntu
- next.js tailwind css
- mysql fix install
- react
- react typescript
- next.js tailwindcss
- next.js css framework
- 리액트 문법
- mysql broken install
- react 기초
- mysql uninstall
- Android
- Docker
- PHP
- mysql 삭제
- react tailwindcss
- 리액트 tailwindcss
- react tailwind css
- Python
- 도커
- mysql 재설치
- 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 |