Giter Club home page Giter Club logo

nittresults's People

Contributors

ssundarraj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

nittresults's Issues

Package

Package the script for distribution.

Doesn't work on slow networks

Sometimes when the network is slow, or the server takes too long to reply, the following line gives an error:

    el = driver.find_element_by_id('Dt1')

Because, the page is reloaded before this happens, and apparently the script keeps running without waiting for the page to reload. A simple fix - add wait() every time elem.send_keys(Keys.RETURN) is executed (in the latestSem function), and modify the getGPA function to this:

def getGPA(rno, sem_id_value):
    elem = driver.find_element_by_name("TextBox1")
    elem.send_keys(Keys.CONTROL, 'a')
    elem.send_keys("\b")
    elem.send_keys(rno)
    elem.send_keys(Keys.RETURN)
    wait()
    el = driver.find_element_by_id('Dt1')
    for option in el.find_elements_by_tag_name('option'):
        if option.get_attribute('value') == sem_id_value:
            option.click()
    wait()
    name = driver.find_element_by_id('LblName').text
    gpa = driver.find_element_by_id('LblGPA').text
    print(str(rno) + "\t" + name + "\t" + gpa)  # Note the brackets - the only line that makes the original script incompatible with py3 is this one.

Here, wait() can be defined to be time.sleep(1). Of course, 1 second might not be enough, so the user will probably still need to modify the script (but only the wait() function).

Alternative is to somehow wait for the page to reload. I don't know how to do that in selenium. Haven't used it before. But this simple hack sufficed for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.