Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ramgreeset/laravel.parcing

Parcing site on Laravel framework
https://github.com/ramgreeset/laravel.parcing

blade-template didom laravel php

Last synced: 19 days ago
JSON representation

Parcing site on Laravel framework

Awesome Lists containing this project

README

        

Laravel.Parcing



Parcing site on Laravel framework
Stack: Laravel, DiDOM

Steps:



  1. Creating a Laravel project

  2. Connecting the DiDOM library

  3. Connecting the Guzzle library

  4. Specify URL for parsing

  5. Create an object of the Client class to send http requests

  6. Send GET request to URL

  7. Save the received response to the $html variable

    • $response->getBody() returns the body of the response - the HTML code of the page.

    • The getContents() method converts the response body to a string.




  8. Parcing

    • The Document object from DiDom is created.

    • The loadHtml($html) method loads HTML content into a Document object for further processing.