承接 megamindame/school_scraper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

megamindame/school_scraper

最新稳定版本:v0.01

Composer 安装命令:

composer create-project megamindame/school_scraper

包简介

This package scrapes all Tanzania's schools from Necta's website.

README 文档

README

A package to scrape Tanzania schools

Usage

Add the package from the composer by running composer require megamindame/school_scraper

If you want to get school data by using this package, not use it in your code, you can uncomment the code section you want in the App.php file,

Using the Package

3 types of data can be accessed from 3 education levels. Education levels 1) Primary 2) Secondary 3)Advanced Secondary

Data that can be accessed

  1. schools - An array of formatted school data
  2. nodes - XPath nodelist of all the html link tags. You can iterate through the list to scrape the results page of a school. Check the Xpath documentation to see how you can use the Xpath node.
  3. data - An array of un-formatted school data

Accessing the data

You can initialize any of the fetchers and pass the year you want to fetch. Images are embedded to show the returned data format.

1) Primary

$fetcher = new PrimaryFetcher(2022);

//Get Primary schools
return $fetcher->getSchools();

image

//Get Data
return $fetcher->getPrimaryData();

image

//Get Nodes
return $fetcher->getNodes();

2) Secondary and Advanced Secondary

$fetcher = new SecondaryFetcher(2022);
//or
$fetcher = new AdvancedSecondaryFetcher(2022);

//Get Primary schools
return $fetcher->getSchools();

image

//Get Data
return $fetcher->getData();

image

//Get Nodes
return $fetcher->getNodes();

People who want to fetch results from the nodes can use the Fetcher->getRootUrl() method to get the Root Url. You can take a look at the code to see how the nodes can be used to fetch their corresponding web pages, in this case, school results pages

As stated above, if you want to use the package as a standalone, then you can just download the code, run composer install then check the 'App.php' file for some directions on how to fetch data. Try to uncomment the sections inside the file, then run php index.php. You can try to run php index.php > filename to save the echoed data into a file.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固