PHP DOM Manipulation toolkit.

Related tags

Scraping phpQuery
Overview

phpQuery

The PHP DOM Manipulation toolkit.

Motivation

I'm working currently with PHP, and I've missed using something like jQuery in PHP to manipulate the DOM. Therefore, I started doing it by myself. I'll improve this, step by step, to make it look like JavaScript's jQuery.

Context

There's a main PHP HTML document mainDoc that calls another PHP document anotherDoc to populate it. As we use either print or echo for returning strings to a PHP GET require, anotherDoc uses phpQuery to create HTML elements and return it to mainDoc. This is a more tidy-up way I found to do it instead of passing raw HTML strings to variables and concatenating it.

Current status

It looks more like Java than with JavaScript 😂

The main class created here that serves for basic uses, like creating headers and stuff, is the DOM_Element. You create it inputting the HTML item type you're creating (such as h2 or img), an array of attributes (like style or class), in name-value order, and the element's content (such as text or other stuff).

It has get and set methods as OOP requires, so you can get the attributes array and the content quite easily.

To render it on the browser, every DOM_Element has a function constructHTML() where it returns a String <type attr="value">content</type>.

Contribute

Testing

Run XAMPP, so it will run PHP on your local machine. (Don't have it? Install XAMPP!) Store this project insied htdocs folder (usually on C:\xampp on Windows. Dunno how it is on Mac or Linux)

Open localhost on your browser and put /phpQueryTest.php in the end of the URL. It will show a test HTML document I've made to show the phpQuery working.

Editing

You can edit phpQuery.php to edit the classes I did, and edit phpContent.php to test its behavior. IMPORTANT: Use Ctrl+F5 to update the page, since that this command reloads all the resources.

You might also like...
Symfony bundle for Roach PHP

roach-php-bundle Symfony bundle for Roach PHP. Roach is a complete web scraping toolkit for PHP. It is a shameless clone heavily inspired by the popul

PHP scraper for ZEE5 Live Streaming URL's Using The Channel ID and Direct Play Anywhere
PHP scraper for ZEE5 Live Streaming URL's Using The Channel ID and Direct Play Anywhere

It can scrape ZEE5 Live Streaming URL's Using The Channel ID and Direct Play Anywhere

PHP library to Scrape website into entity easily

Scraper Scraper can handle multiple request type and transform them into object in order to create some API. Installation composer require rem42/scrap

SAML toolkit for Laravel based on OneLogin's SAML PHP Toolkit.

Laravel SAML SAML toolkit for Laravel based on OneLogin's SAML PHP Toolkit. Installation composer require overtrue/laravel-saml Configuration php arti

📜 Modern Simple HTML DOM Parser for PHP

📜 Simple Html Dom Parser for PHP A HTML DOM parser written in PHP - let you manipulate HTML in a very easy way! This is a fork of PHP Simple HTML DOM

 PHP SİMPLE HTML DOM with news website
PHP SİMPLE HTML DOM with news website

PHP SİMPLE HTML DOM with news website I found a library that can pull data from a site to my own site with php. I used it and pulled the yield from a

php html parser,类似与PHP Simple HTML DOM Parser,但是比它快好几倍

HtmlParser php html解析工具,类似与PHP Simple HTML DOM Parser。 由于基于php模块dom,所以在解析html时的效率比 PHP Simple HTML DOM Parser 快好几倍。 注意:html代码必须是utf-8编码字符,如果不是请转成utf-8

Html-sanitizer - The HtmlSanitizer component provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a document's DOM.

HtmlSanitizer Component The HtmlSanitizer component provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a documen

A simple library for management the DOM (XML, HTML) document.

A simple library for management the DOM (XML, HTML) document.

Provides tools for working with DOM documents and structures

laminas-dom This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Render a Livewire component on a specific target in the DOM.

Livewire Portals Render a Livewire component on a specific target in the DOM. Install THIS PACKAGE IS STILL IN DEVELOPMENT, TO USE, PLEASE ADD THE FOL

php binding for IUP  toolkit
php binding for IUP toolkit

php-iup php-ffi experiment php7.4 interface to the IUP toolkit for building GUI's. Description IUP-Toolkit IUP is a multi-platform toolkit for buildin

QPM, the process management framework in PHP, the efficient toolkit for CLI development. QPM provides basic daemon functions and supervision mechanisms to simplify multi-process app dev.

QPM QPM全名是 Quick(or Q's) Process Management Framework for PHP. PHP 是强大的web开发语言,以至于大家常常忘记PHP 可以用来开发健壮的命令行(CLI)程序以至于daemon程序。 而编写daemon程序免不了与各种进程管理打交道。Q

A simple PHP Toolkit to parallel generate combinations, save and use the generated terms to brute force attack via the http protocol.
A simple PHP Toolkit to parallel generate combinations, save and use the generated terms to brute force attack via the http protocol.

Brutal A simple PHP Toolkit to parallel generate combinations, save and use the generated terms to apply brute force attack via the http protocol. Bru

The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit.

Slim & Eloquent The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit. Getting started # Download composer curl -s https://ge

Roach is a complete web scraping toolkit for PHP

🐴 Roach A complete web scraping toolkit for PHP About Roach is a complete web scraping toolkit for PHP. It is heavily inspired (read: a shameless clo

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. /// Chat with us and others on Spectrum: https://spectrum.chat/twill
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. /// Chat with us and others on Spectrum: https://spectrum.chat/twill

About Twill Twill is an open source Laravel package that helps developers rapidly create a custom CMS that is beautiful, powerful, and flexible. By st

A toolkit for using self-hosted Natural Language Processing with Elasticsearch and WordPress

Natural Language Processing Tools for WordPress A toolkit for using self-hosted Natural Language Processing in WordPress This plugin is a Proof of Con

 📦    A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.

create-guten-block is zero configuration dev-toolkit (#0CJS) to develop WordPress Gutenberg blocks in a matter of minutes without configuring React, w

Owner
João Eduardo Fornazari
Undergrad in Computer Science at UTFPR-Ponta Grossa, Paraná. JS, Node.js, MySQL, Express, PHP (pure), Python, Java.
João Eduardo Fornazari
PHP Scraper - an highly opinionated web-interface for PHP

PHP Scraper An opinionated & limited way to scrape the web using PHP. The main goal is to get stuff done instead of getting distracted with xPath sele

Peter Thaleikis 327 Dec 30, 2022
Goutte, a simple PHP Web Scraper

Goutte, a simple PHP Web Scraper Goutte is a screen scraping and web crawling library for PHP. Goutte provides a nice API to crawl websites and extrac

null 9.1k Jan 1, 2023
A configurable and extensible PHP web spider

Note on backwards compatibility break: since v0.5.0, Symfony EventDispatcher v3 is no longer supported and PHP Spider requires v4 or v5. If you are st

Matthijs van den Bos 1.3k Dec 28, 2022
A browser testing and web crawling library for PHP and Symfony

A browser testing and web scraping library for PHP and Symfony Panther is a convenient standalone library to scrape websites and to run end-to-end tes

Symfony 2.7k Dec 31, 2022
🕷 CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent

crawlerdetect.io About CrawlerDetect CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent and http_from header. Current

Mark Beech 1.7k Dec 30, 2022
:spider: The progressive PHP crawler framework! 优雅的渐进式PHP采集框架。

QueryList QueryList is a simple, elegant, extensible PHP Web Scraper (crawler/spider) ,based on phpQuery. API Documentation 中文文档 Features Have the sam

Jaeger(黄杰) 2.5k Dec 27, 2022
Goutte, a simple PHP Web Scraper

Goutte, a simple PHP Web Scraper Goutte is a screen scraping and web crawling library for PHP. Goutte provides a nice API to crawl websites and extrac

null 9.1k Jan 4, 2023
PHP Discord Webcrawler to log all messages from a Discord Chat.

Disco the Ripper was created to rip all messages from a Discord specific channel into JSON via CLI and help people to investigate some servers who has awkward channels before they get deleted.

Daniel Reis 46 Sep 21, 2022
This Project is for digikala.com scrapping challenge of 2021 blackfriday using php/laravel/horizon

Objective This script is intended for finding the hidden treasure, A scraping challenge by digikala for 2021 black Friday Prerequisites Php mysql redi

ǃшɒʞɒH ǃǀɄ 1 Dec 22, 2021
Beanbun 是用 PHP 编写的多进程网络爬虫框架,具有良好的开放性、高可扩展性,基于 Workerman

Beanbun 是用 PHP 编写的多进程网络爬虫框架,具有良好的开放性、高可扩展性,基于 Workerman

Kidd Yu 1.2k Dec 19, 2022