🏢 Published by: Jagaad Academy
This mini-course present how to create a web scraping from scratch using PHP. Even those who are not familiar with PHP but understand basic programming concepts will be able to reproduce the steps shown in this mini-course. And, with a little more time, you can use the techniques presented to create your PHP script.
The mini-course starts by presenting how to set up the environment (on Windows). Then, it goes through understanding Web Crawler and Web Scraping, PHP basics concepts overview, and creating a simple script to collect data from websites. Finally, we'll improve the created code using more advanced PHP techniques.
Note: During the mini-course, there are some jumps between basics and intermediate PHP concepts to see a little more about the language features.
Tools installed at the beginning of the mini-course:
- XAMPP: It provides the PHP executable
- Composer: The PHP package manager. Its installer provides the environment variable configuration also for PHP
- Git Bash (Windows): It provides a terminal (Unix-like) containing the Git command
The main commands used during the mini-course:
pwd
: Show the current directory pathmkdir jagaad.academy
: Create the directoryjagaad.academy
cd jagaad.academy
: Change the directory to the passed one, in this casejagaad.academy
mkdir php-basics
: Create the directoryphp-basics
cd php-basics
: Change the directory to the passed one, in this casephp-basics
clear
: Clear the visible commands in the terminal
Check out the Basic UNIX commands by Stanford to learn more.
You can find in this repository the code created in the mini-course:
Links for the main contents presented during the mini-course:
- Variable by reference
- Arrays
- Loops
- Functions
- Classes
- DOMDocument
- DOMXPath
- Generators
- Package: Goutte PHP Web Scraper
Check out the PHP complete documentation containing more details about each of the functionalities.