Download the PHP package megamindame/school_scraper without Composer

On this page you can find all versions of the php package megamindame/school_scraper. 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 school_scraper

school-scrapper

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.


All versions of school_scraper with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.0
guzzlehttp/guzzle Version ^7.7
ext-libxml Version *
ext-dom Version *
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 megamindame/school_scraper contains the following files

Loading the files please wait ....