Learn How to Extract Data From Websites with PHP
3.5 (17 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
169 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Learn How to Extract Data From Websites with PHP to your Wishlist.

Add to Wishlist

Learn How to Extract Data From Websites with PHP

You will turn websites into data provider that you can consume whenever you want with PHP. Write your own data collector
3.5 (17 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
169 students enrolled
Created by Orhan Doğan
Last updated 3/2015
English
Price: $60
30-Day Money-Back Guarantee
Includes:
  • 2.5 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Understand What is Scraping and API
  • Fetch Data From Websites with PHP
  • Extract Data From Websites with PHP
  • Save Extracted Data to MySQL
  • Use cronjob in Linux
View Curriculum
Requirements
  • Basic PHP programming experience
  • PHP editor
Description
  • Did you need any data from a website?
  • Did you try to fetch and extract data from a website with PHP?
  • Did you write any aggregator and scheduled a cron job before?
  • What about extraction data from HTML, Did you try before?
  • Do you want to collect data from websites and build yours?

Fetching data from a website has endless possibilities: exchange rates, country names, product titles, product images, customer comments, song names, links, emails etc... Did you know that you can do it with PHP?

In this course you will learn how to fetch data from websites and how to play with it like play dough. You will learn extracting data within HTML which you has been already fetched.

It is okey that your target websites has an API, but if they don't have, you can turn that websites into convenient data provider that you can consume whenever you want with PHP.

Collect your data put them into Word, Excel or Convert it to PDF or write another HTML on your own way. And also, you can create your brand new web site contains data which you fetched and extracted with PHP.

To make being clear everything in your mind, we will create an PHP project towards to end of training. We will be using cron jobs to make everything will be working in auto pilot.

Who is the target audience?
  • Intermediate or above PHP Developers
Students Who Viewed This Course Also Viewed
Curriculum For This Course
Expand All 21 Lectures Collapse All 21 Lectures 02:23:47
+
Introduction
1 Lecture 02:04

You will learn that what is the content of the whole course. What will you learn, need etc..

Preview 02:04
+
API vs Scraping
3 Lectures 11:42

In this lesson,You will learn that what scraping is. After lesson you will have comprehensive understanding of content scraping, What is it, where you can use it. what's the benefits.

Preview 04:09

In this lesson,You will learn that what API is, how it works, what' is the basic benefits. After lesson you will have general idea about API.

Preview 02:50

In this lesson we will compare API and Scraping. After lesson you will be known basic pros and cons API and Scraping.

Preview 04:43
+
Fetching Data
6 Lectures 22:20

In this lesson we will learn usage of file_get_contents() PHP function. We will use HTTP Headers with the function.

Reading Local File or Remote Page to Extract
02:56

In this lesson you will learn cURL functions at PHP and some tricks about fetching content from websites. We will talk about securely connecting to websites.

Curl usage in PHP
05:22

In this lesson we will talk about hiding yourself from remote servers when you make requests frequently. You will learn that how to protect your code banning from remote server.

Hide Yourself from Remote Server with CURL
04:15

In this lesson we gonna talk about HTTPS request with curl. End of the lesson you will be making https requests and know about certificate issues. Sometimes your https request fails, you will learn that why?

Fetch Data over HTTPS with CURL
02:56

In this lesson we will talk about usage of cookie, encoding and custom headers with cURL. Let's start with cookie usage.

Cookie, Encoding, and Custom headers with CURL
04:56

In this lesson we will talk about json encoding. You will learn that what is JSON and JSON encoder and decoder functions at PHP.

Converting Fetched Data to JSON
01:55
+
Data Extraction
8 Lectures 01:23:55

In this lesson you will learn that how to find patterns in html or other semi structured content.

Defining and Seeking Pattern Blocks in HTML
05:21

In this lesson you will learn that What Regex (Regular Expressions) is and why we need it?

What is REGEX? Why We Need?
12:23

In this lesson you will learn preg_match() function of PHP.

Usage of preg_match() function
08:43

In this lesson you will learn preg_match_all() function of PHP.

Usage of preg_match_all() function
04:59

In this lesson you will learn that extraction data from a local file. We will use file_get_content and preg_match_all functions of PHP to extract data. As an example, we will extract data from Wikipedia.

Example 1: Exploring patterns and Extracting Data From Local HTML File
07:41

In this lesson you will learn that extraction data from a remote web site. We will use file_get_content and preg_match_all functions of PHP to extract data. As an example, we will extract data from Trulia.

Example 2: Exploring patterns and Extracting Data with file_get_content()
08:46

In this lesson you will learn that extraction data from a remote web site. We will use cURL and preg_match_all functions of PHP to extract data. I want to get weather information of London. So, We'll use Yahoo's weather page to extract data.

Example 3: Exploring patterns and Extracting Data with CURL
20:00

In this lesson you'll learn how to use an open source, easily learned parser, to read, modify, and spit back out HTML from external sources. Using Foyow's products as an example, you'll learn how to get a list of all the products on the site's homepage and display them.

PHP Simple HTML DOM Parser
16:02
+
Cron Jobs
2 Lectures 16:45

In this lesson you will learn what cron jobs is. Cron Jobs are used for scheduling tasks to run on the server. They're most commonly used for automating system maintenance or administration. However, they are also relevant to web application development. There are many situations when a web application may need certain tasks to run periodically. You can use cronjob to fetch webpages in schedule. You will learn about cronjobs at linux.

Cron Jobs in Linux
12:16

In this lesson you will learn that how to make single instance of your cron script.

In some cases you may have frequent running cron jobs, and you may not want them to collide if they take longer to run than the frequency itself.

For example, you may have a cron job running every minute. Yet, every once in a while it may take longer than one minute to run.

This can cause another instance of the same cron script to start running before the previous one finishes. You will learn that how to prevent it.
Single Instance at Linux
04:29
+
Bonus
1 Lecture 07:01

In this lesson I will introduce you 2 services for your quick scraping needs.

Two services for your quick scraping needs
07:01
About the Instructor
Orhan Doğan
3.5 Average rating
17 Reviews
169 Students
1 Course
Software Developer, Instructor

Orhan is an software developer and entrepreneur with much experience from different projects and many different programming languages.

Worked for heavy loaded web sites like eBay / Gittigidiyor, Sahibinden, Secretcv, Foyow, etc.

Orhan has 16 years experience at Software Development and Internet business and skilled with: PHP, MySQL, ZendFramework, Smarty, Java, Spring Framework, Solr / Lucene, Sphinx, MongoDB, Redis, Memcache, Git, SVN. I love working on High Available systems.

Research-Development and Teaching has been my passion since a long time. My aim to learn, use and teach technology the way it is used in industry and professional world.

I've decided to share my experience with the world via udemy. I'm waiting you at my cources.