Download the PHP package arefshojaei/spider without Composer
On this page you can find all versions of the php package arefshojaei/spider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arefshojaei/spider
More information about arefshojaei/spider
Files in arefshojaei/spider
Informations about the package spider
โจ Features
- ๐ Load and parse any HTML web page
- ๐ CSS selector-based element searching
- ๐ Extract text, HTML, and attributes
- ๐ Iterate over multiple DOM elements
- ๐งน Remove and clean HTML elements
- ๐๏ธ Modify the DOM structure dynamically
- ๐จ Manage CSS classes and IDs
- ๐พ Export modified HTML documents
- โก Lightweight and dependency-free PHP implementation
๐ฅ Installation
Install with Composer
Clone from GitHub
๐ Quick Start
Fetch a page and extract its content:
๐ Finding Elements
Search DOM elements using CSS selectors.
Find a single element
Find multiple elements
๐ Iterating Elements
Perform operations on element collections.
each()
Loop through every element:
map()
Transform elements:
filter()
Filter elements by a condition:
๐ณ DOM Traversing
Navigate and modify element relationships.
Parent element
Insert sibling elements
Insert child elements
๐งน Cleaning Elements
Remove content or complete elements.
Empty content
Remove element
๐ Working with Content
Get text or HTML
Update content
๐ท๏ธ Working with Attributes
Read attributes
Set attributes
๐จ CSS Classes & IDs
Classes
IDs
๐พ Export HTML
Save the current DOM document to a file.
๐ก Example Use Cases
Spider can be used for:
- Web scraping and data extraction
- SEO analysis
- Content migration
- HTML cleaning and transformation
- Static website processing
- Automated testing of HTML pages
- Learning how browser DOM engines work
๐ฅ Why Spider?
Spider brings the simplicity of jQuery-style DOM APIs into PHP.
Instead of dealing with complex DOMDocument operations, you can navigate and manipulate HTML documents using a clean and expressive syntax.
It is a great educational project for learning:
- Web crawling concepts
- HTML parsing
- DOM tree manipulation
- CSS selector engines
- Collection processing
- Parser design
๐ค Contributing
Contributions are welcome.
-
Fork the repository
-
Create a feature branch:
-
Commit your changes:
-
Push your branch:
- Open a Pull Request.
๐จโ๐ป Author
Aref Shojaei
- ๐ง Email: [email protected]
- ๐ GitHub: @ArefShojaei
- ๐ฆ Packagist: arefshojaei/spider
โญ Show Your Support
If this project helps you understand web crawling, HTML parsing, and DOM manipulation, consider giving it a Star โญ on GitHub.
Your support motivates future improvements.