Advertisement
fenix_of_fire

Crosshairs_of_HTTP_screenshot

Aug 2nd, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.38 KB | None | 0 0
  1. #########################################################################################################
  2. ## Please note that this script uses chrome or chromium for screenshots, if the code doesn't work      ##
  3. ## make sure that chromium or chrome opens normally for the current user running /usr/bin/chromium     ##
  4. ## or /usr/bin/chrome If you have difficulty running this send me an email: feniximperialpro@gmail.com ##
  5. #########################################################################################################
  6. ####  Please execute: pip install Selenium-Screenshot  AND  apt-get install chromium-driver --yes     ###
  7. #########################################################################################################
  8. #--------------------------------------------------------------------------------------------------------
  9. ### LIBS
  10. #--------------------------------------------------------------------------------------------------------
  11. from Screenshot import Screenshot_Clipping
  12. from selenium import webdriver
  13. import sys
  14. import os
  15. #--------------------------------------------------------------------------------------------------------
  16. #--------------------------------------------------------------------------------------------------------
  17. ### CHECK THE SYNTAX AND PRINT THE USAGE
  18. #--------------------------------------------------------------------------------------------------------
  19. if len(sys.argv) != 2:
  20.     print "Usage: "+sys.argv[0]+" https://URL_SITE/"
  21.     print "Example: python "+sys.argv[0]+" https://www.google.com"
  22.     sys.exit(0)
  23. #--------------------------------------------------------------------------------------------------------
  24. ### MAIN
  25. #--------------------------------------------------------------------------------------------------------
  26. ob=Screenshot_Clipping.Screenshot()
  27. driver = webdriver.Chrome()
  28. url = sys.argv[1] #Url treating
  29. if not url.startswith("http"): #Url treating
  30.     url = "http://" + url #Url treating
  31. driver.get(url)
  32. name = url.replace(".", "").replace("/", "").replace(":","") #Created the image name
  33. img_url=ob.full_Screenshot(driver, image_name=name+'.png') #Created image name
  34. driver.close()
  35. driver.quit()
  36. #--------------------------------------------------------------------------------------------------------
  37. ### END !
  38. #--------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement