Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #########################################################################################################
- ## Please note that this script uses chrome or chromium for screenshots, if the code doesn't work ##
- ## make sure that chromium or chrome opens normally for the current user running /usr/bin/chromium ##
- ## or /usr/bin/chrome If you have difficulty running this send me an email: feniximperialpro@gmail.com ##
- #########################################################################################################
- #### Please execute: pip install Selenium-Screenshot AND apt-get install chromium-driver --yes ###
- #########################################################################################################
- #--------------------------------------------------------------------------------------------------------
- ### LIBS
- #--------------------------------------------------------------------------------------------------------
- from Screenshot import Screenshot_Clipping
- from selenium import webdriver
- import sys
- import os
- #--------------------------------------------------------------------------------------------------------
- #--------------------------------------------------------------------------------------------------------
- ### CHECK THE SYNTAX AND PRINT THE USAGE
- #--------------------------------------------------------------------------------------------------------
- if len(sys.argv) != 2:
- print "Usage: "+sys.argv[0]+" https://URL_SITE/"
- print "Example: python "+sys.argv[0]+" https://www.google.com"
- sys.exit(0)
- #--------------------------------------------------------------------------------------------------------
- ### MAIN
- #--------------------------------------------------------------------------------------------------------
- ob=Screenshot_Clipping.Screenshot()
- driver = webdriver.Chrome()
- url = sys.argv[1] #Url treating
- if not url.startswith("http"): #Url treating
- url = "http://" + url #Url treating
- driver.get(url)
- name = url.replace(".", "").replace("/", "").replace(":","") #Created the image name
- img_url=ob.full_Screenshot(driver, image_name=name+'.png') #Created image name
- driver.close()
- driver.quit()
- #--------------------------------------------------------------------------------------------------------
- ### END !
- #--------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement