Download the PHP package cheukfung/zfcrawler without Composer

On this page you can find all versions of the php package cheukfung/zfcrawler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zfcrawler

简介

正方教务系统爬虫。

一份代码,通用全部学校的正方教务系统

感谢

受到@lndj 的Lcrawl项目启发,项目地址:https://github.com/lndj/Lcrawl

我用browser kit库写了模拟登录的代码

现在不需要再去管viewstate了,只需要知道链接的中文名称,和表格的ID即可

安装

下载zip包或clone到本地后,执行:

或者直接在项目文件夹执行:

配置

由于每一个学校的正方教务都不尽相同,为了适应每一个学校,在实例化的时候传入配置参数即可

例子

Exception

在这里我只对少量的错误进行了判断,并且只是简单的throw一个Exception

容错可能不是很好,根据自己的情况进行修改

Exception Code:

10001:登录失败,教务系统返回相关alert
10002:无法根据中文名称获取相关功能的页面url(原因:配置错误、教务系统关闭了页面入口)
10003:查询成绩或其他信息出错,教务系统返回alert,比如没有评教时查询成绩
10004:处理课表时出错,无法找到table

20001:页面访问出错(非200状态码),请检查网络的连通性,也不排除被反爬限制了
20002:正方教务系统返回ERROR错误,原因未知,可能为:访问量太大,教务系统崩溃,被反爬策略识别,登录参数错误等等

PHP 5.4

由于用到guzzleHttp,所以在php5.4里面运行会出错,原因是5.5之前没有curl_reset这个函数

解决方法就是把 guzzlehttp/guzzle/src/Handler/CurlFactory.php的curl_reset($resource);改为 $resource = curl_init();

案例

课程表

成绩

License

MIT License


All versions of zfcrawler with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
guzzlehttp/guzzle Version ~6.2.2
symfony/dom-crawler Version 3.3
symfony/css-selector Version 3.3
symfony/browser-kit Version 3.3
fabpot/goutte Version ~3.1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cheukfung/zfcrawler contains the following files

Loading the files please wait ....