Skip to content

Instantly share code, notes, and snippets.

@brianddk
Created April 13, 2015 15:14
Show Gist options
  • Select an option

  • Save brianddk/fa30efdb253356e1073f to your computer and use it in GitHub Desktop.

Select an option

Save brianddk/fa30efdb253356e1073f to your computer and use it in GitHub Desktop.
Script to use selenium to get private reports from edline
# selenium http://www.seleniumhq.org/download/
# chromedriver https://sites.google.com/a/chromium.org/chromedriver/downloads
# docs http://selenium-python.readthedocs.org/en/latest/index.html
import time, sys, os
from getpass import getpass
try:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
except:
print "###\n", "Required modules missing, to acquire:\n", "\t'pip install selenium wget'"
sys.exit(-1)
screenNameTxt = raw_input("Username: ")
kclqTxt = getpass("Password: ")
usrTxt = raw_input("Userhash: ")
try:
driver = webdriver.Chrome()
except:
fname = os.path.join(sys.exec_prefix, 'Scripts', 'chromedriver.exe')
if os.path.exists(fname):
print "###\nEnsure '%s' is in your path" % fname
else:
print "###\nCouldn't find '%s', To aquire:\n" % fname
print "\t'python wget http://chromedriver.storage.googleapis.com/2.15/chromedriver_win32.zip'"
sys.exit(-1)
driver.get('https://www.edline.net/Index.page');
time.sleep(1)
screenName = driver.find_element_by_name('screenName')
screenName.send_keys(screenNameTxt)
time.sleep(1)
kclq = driver.find_element_by_name('kclq')
kclq.send_keys(kclqTxt)
kclq.send_keys(Keys.RETURN)
time.sleep(1)
driver.execute_script("submitEvent('viewUserDocList', 'TCNK=headerComponent')");
time.sleep(1)
driver.get('https://www.edline.net/UserDocList.page?vusr=%s' % usrTxt);
time.sleep(5)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment