selenium clicknium - 브라우저 자동화 도구 - 해당 url 자동으로 인쇄하기 > 소스코드

본문 바로가기

회원로그인

회원가입

소스코드

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

페이지 정보

profile_image
작성자 최고관리자
댓글 0건 조회 85회 작성일 23-07-31 10:39

본문


https://wikidocs.net/177133





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()
------------------------------------

댓글목록

등록된 댓글이 없습니다.