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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue