GithubHelp home page GithubHelp logo

iostream-cout / a-web-spider-to-crawl-the-educational-administration-system-of-uestc Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 15 KB

通过爬虫登录电子科技大学信息门户教务系统。通过一个调用就可以获得某科目分数。

Python 100.00%
webspider uestc uestc-eams

a-web-spider-to-crawl-the-educational-administration-system-of-uestc's Introduction

A-Web-Spider-to-Crawl-the-Educational-Administration-System-of-UESTC

[Introduction] This package provides a web spider interface to crawl the Educational Administration System of UESTC(University of Electronic Science of China). The spider does no harm to the system if used properly and legally. The basic functions of the package include logging into the system by posting your username and your password, getting your final score of a certain course and getting your GPA. The interface of the package is extensible. You can develop your own interfaces according to your need.

[APIs]

Functions:

getGrade(username, password, course_name): Returns your final score corresponding to the course name you provide.If no course is found to match the course name, it will return None.

getGPA(username, password): Returns your GPA in float type.

Class:

Login(object):

Interfaces:

init(self, username, password): When creating a Login object you should provide your username, and your password.

log(self, username, username): This method simply does the work of logging into the system and does nothing else.

visit(self, url): This method returns a Response object after making an HTTP request to the provided URL.If the request fails to get the right response, it will call the log method again and again until the aimed page is available.

close(self): This method should be called before the end of the programme. It saves the cookies to a file.

[Examples]

        import uestclogin
	print getGrade('201601010101001', '123456', u'微积分I')

This code prints your final score of '微积分I'.

	import uestclogin
	print getGPA('2016010101001', '123456')

This code prints your GPA.

	from uestclogin import Login
	try:
	    login = Login('2016120101001', '123456')
	    print login.visit('http://portal.uestc.edu.cn/').text
	finally:
	    login.close()

This code prints the HTML of the homepage of the UESTC portal.

a-web-spider-to-crawl-the-educational-administration-system-of-uestc's People

Contributors

iostream-cout avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.