python selenium clicknium - 브라우저 자동화 도구 - 해당 url 자동으로 인쇄하기
페이지 정보

본문
selenium : https://www.selenium.dev/
Selenium automates browsers. That's it!
What you do with that power is entirely up to you.
Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that.
Boring web-based administration tasks can (and should) also be automated as well.
clicknium : https://www.clicknium.com/
Focus on What to Automate, not How
Clicknium provides the easiest way to write automation for your business
드라이버
Chrome: https://chromedriver.chromium.org/downloads
Edge: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Firefox: https://github.com/mozilla/geckodriver/releases
Safari: https://webkit.org/blog/6900/webdriver-support-in-safari-10/
======================================================
se.py 파일
------------------------------------
'''
https://www.selenium.dev
https://www.selenium.dev/documentation/webdriver/browsers/firefox/
https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions
https://pypi.org/project/selenium/
> pip install selenium
'''
import time
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
'''
browser = webdriver.Firefox()
browser.get('http://www.google.co.kr')
browser.quit()
'''
options = FirefoxOptions()
options.add_argument("--headless")
options.set_preference("print.always_print_silent",True)
browser = webdriver.Firefox(options=options)
# get source code
browser.get("http://google.co.kr")
browser.execute_script("window.print();")
html = browser.page_source
#print(html)
# close web browser
browser.close()
https://www.selenium.dev
https://www.selenium.dev/documentation/webdriver/browsers/firefox/
https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions
https://pypi.org/project/selenium/
> pip install selenium
'''
import time
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
'''
browser = webdriver.Firefox()
browser.get('http://www.google.co.kr')
browser.quit()
'''
options = FirefoxOptions()
options.add_argument("--headless")
options.set_preference("print.always_print_silent",True)
browser = webdriver.Firefox(options=options)
# get source code
browser.get("http://google.co.kr")
browser.execute_script("window.print();")
html = browser.page_source
#print(html)
# close web browser
browser.close()
------------------------------------
- 이전글pipenv 가상환경 구성하기 23.07.31
- 다음글웹서버 부하 테스트 하기 - locust 23.07.13
댓글목록
등록된 댓글이 없습니다.