Last active
December 22, 2015 23:59
-
-
Save bmanojlovic/6550914 to your computer and use it in GitHub Desktop.
selenium tricks
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
#!/bin/sh -x | |
export PATH=$PATH:phantomjs-?.?.?-linux-x86_64/bin | |
./zm.py |
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
#!/usr/bin/env python | |
import time | |
from selenium import webdriver | |
browser = webdriver.PhantomJS() | |
browser.implicitly_wait(30) | |
browser.get('http://lsv002.zis.co.yu/zm/') | |
browser.find_element_by_name("username").send_keys("operator") | |
browser.find_element_by_name("password").send_keys("operator") | |
browser.find_element_by_css_selector("input[type=\"submit\"]").click() | |
time.sleep(2); | |
browser.set_window_size("1024","800") | |
browser.save_screenshot('screenshot.png') | |
browser.quit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment