From 9388f08156d0d73c54b6e46aa86784fc43b3a82c Mon Sep 17 00:00:00 2001 From: hubobel Date: Tue, 12 Feb 2019 20:22:03 +0100 Subject: [PATCH] aktueller Stand --- Screenshot.py | 36 ++++++++++++++++++++++++++++++++++++ Screenshot2.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ pass1.json | 31 +++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 Screenshot.py create mode 100644 Screenshot2.py create mode 100644 pass1.json diff --git a/Screenshot.py b/Screenshot.py new file mode 100644 index 0000000..b7dcaa9 --- /dev/null +++ b/Screenshot.py @@ -0,0 +1,36 @@ +from selenium import webdriver +from time import sleep +driver = webdriver.Chrome() + +driver.get("https://www.youtube.com") + + +# scroll some more +for isec in (4, 3, 2, 1): + driver.execute_script("window.scrollTo(0, document.body.scrollHeight / %s);" % isec) + sleep(1) + +# load more +sleep(2) +print("push Load more...") +#driver.find_element_by_css_selector('button.load-more-button').click() + +print("wait a bit...") +sleep(2) + +print("Jump to the bottom, work our way back up") +for isec in (1, 2, 3, 4, 5): + driver.execute_script("window.scrollTo(0, document.body.scrollHeight / %s);" % isec) + sleep(1) + +driver.execute_script("window.scrollTo(0, 0)") +print("Pausin a bit...") +sleep(2) +print("Scrollin to the top so that the nav bar isn't funny looking") +driver.execute_script("window.scrollTo(0, 0);") + + +sleep(1) +print("Screenshotting...") +# screenshot +driver.save_screenshot("youtube.com.jpg") \ No newline at end of file diff --git a/Screenshot2.py b/Screenshot2.py new file mode 100644 index 0000000..2967566 --- /dev/null +++ b/Screenshot2.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +from selenium import webdriver +from selenium.webdriver.chrome.options import Options +import telebot +import sys +from time import sleep + +Pfad='' +#Pfad='/home/' + +#todo +# Einbau User Agent +# kompletter screenshot!!!! + +url=sys.argv[1] +url = url.replace ('http://','') +url = 'http://' + url + +ios6ua = '--user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1"' + +if (len(sys.argv)) == 3: + zoom = sys.argv[2] +else: + zoom = '1' +options = Options() +# options.add_argument('--headless') +# options.add_argument('--no-sandbox') +# options.add_argument('--disable-dev-shm-usage') +options.add_argument(ios6ua) +print(options.arguments) +driver=webdriver.Chrome(chrome_options=options) +#driver.set_window_size(1024, 768) +driver.get(url) +driver.execute_script("document.body.style.zoom='"+zoom+"'") + + +for isec in (4, 3, 2, 1): + driver.execute_script("window.scrollTo(0, document.body.scrollHeight / %s);" % isec) + sleep(1) +driver.save_screenshot(Pfad+"dashboard.png") +driver.close() + + + +# TOKEN='680737840:AAEaa7Vxl_kZz_LWS1_S-lH6Eda7HXqu6Y4' +# ChatID='322673713' +# tb = telebot.TeleBot(TOKEN) +# document=open(Pfad+'dashboard.png','rb') +# tb.send_photo(ChatID,document) \ No newline at end of file diff --git a/pass1.json b/pass1.json new file mode 100644 index 0000000..9f40226 --- /dev/null +++ b/pass1.json @@ -0,0 +1,31 @@ +{ + "Chat_ID": "@mpglu", + "Land": "rp", + "TOKEN": "467241832:AAH3e0y6Fm7ig5DtConJP29GsD-zX1psNZo", + "Tag_Name": "Thursday", + "Tag_Nummer": "4", + "Uhrzeit": "11:51:38", + "autor": "Emil G\u00f6tt", + "ccu_ip": "10.0.1.100", + "debug": "True", + "debug_Chat_ID": "322673713", + "debug_TOKEN": "312534798:AAFbMjS-tfd2BiZ_j3NEZuQYKwzACMcioVo", + "debug_adress": "carsten@hubobel.de", + "gmail_pass": "PL19zPL19z", + "gmail_user": "carsten.richter77@gmail.com", + "lotto": [ + 3, + 6, + 16, + 24, + 31, + 40, + 5 + ], + "mpg_pass": "Ing8gresk", + "mpg_user": "schueler", + "pfad": "/Users/hubobel/Documents/Python/HubobelsPython", + "wetter_API": "35a8e37c649985d5", + "wetter_Ort": "ILUDWIGS227", + "zitat": "Was du verlieren kannst, hat keinen Wert." +} \ No newline at end of file