Created
June 7, 2018 01:54
-
-
Save yevbar/093e4f9502d5f5507658da357b5ee348 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
#geckodriver = 'C:\\Users\\grayson\\Downloads\\geckodriver.exe' | |
options = webdriver.FirefoxOptions() | |
#options.add_argument('-headless') | |
browser = webdriver.Firefox(firefox_options=options) | |
browser.get('https://repl.it/ibuiltthis/bots/?sort=new') | |
#browser.send_keys(Keys.ESCAPE) | |
browser.implicitly_wait(5) | |
browser.find_element_by_xpath("/html/body/div[1]/div/div[1]/div/div/div[2]/div/div[2]/div/div[3]/div[2]/form/div[1]/div/div/input").send_keys(Keys.ESCAPE) | |
browser.implicitly_wait(10) | |
from time import sleep | |
sleep(60) | |
condition = True | |
previous_height = 0 | |
while condition: | |
previous_height = browser.execute_script("return document.body.scrollHeight") | |
browser.execute("window.scrollTo(0,document.body.scrollHeight)"); | |
browser.save_screenshot('image.png') | |
browser.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment