aktueller Stand
This commit is contained in:
parent
9775f8991d
commit
9388f08156
3 changed files with 117 additions and 0 deletions
36
Screenshot.py
Normal file
36
Screenshot.py
Normal file
|
|
@ -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")
|
||||||
50
Screenshot2.py
Normal file
50
Screenshot2.py
Normal file
|
|
@ -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)
|
||||||
31
pass1.json
Normal file
31
pass1.json
Normal file
|
|
@ -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."
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue