PHP Web Automation Introduction - Supercoders | Web Development and Design | Tutorial for Java, PHP, HTML, Javascript PHP Web Automation Introduction - Supercoders | Web Development and Design | Tutorial for Java, PHP, HTML, Javascript

Breaking

Post Top Ad

Post Top Ad

Sunday, June 16, 2019

PHP Web Automation Introduction

PHP Web Automation



Introduction


Most of the time, PHP is part of a web server, sending content to browsers. Even when you run it from the command line, it usually performs a task and then prints some output. PHP can also be useful, however, playing the role of a web client, retrievingURLs and then operating on the content. Whereas discusses retrieving URLs from within PHP, this chapter explores how to process the received content.

Recipes help you manipulate those page contents. Demonstrates how to mark up certain words in a page with blocks of color. This technique is useful for highlighting search terms, for example. Cleaning up HTML so it’s easier to parse and is standards compliant, is the topic provides a function to find all the links in a page. This is an essential building block for a web spider or a link checker. Converting between plain text and HTML is covered. Shows how to remove all HTML and PHP tags from a web page.

Discuss how PHP and JavaScript can work together. Explores using PHP to respond to requests made by JavaScript, in which you have to be concerned about caching and using alternate content types. Provides a full-fledged example of PHP–JavaScript integration using the popular and powerful jQuery toolkit.

Two sample programs use the link extractor. The program scans the links in a page and reports which are still valid, which have been moved, and which no longer work. The program reports on the freshness of links. It tells you when a linked-to page was last modified and if it’s been moved.


No comments:

Post a Comment

Post Top Ad