informatique:php
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
informatique:php [26/12/2022 07:54] – [Goutte] cyrille | informatique:php [27/12/2022 10:12] – [PHP] cyrille | ||
---|---|---|---|
Ligne 9: | Ligne 9: | ||
[[/ | [[/ | ||
- | Installer Php/ | + | |
+ | Installer | ||
+ | < | ||
+ | sudo apt install software-properties-common | ||
+ | sudo add-apt-repository ppa: | ||
+ | sudo apt update | ||
+ | </ | ||
===== Application Frameworks ===== | ===== Application Frameworks ===== | ||
Ligne 288: | Ligne 295: | ||
==== Html & DOM scraper ==== | ==== Html & DOM scraper ==== | ||
+ | |||
+ | === Simple HTML DOM === | ||
+ | |||
+ | https:// | ||
+ | |||
+ | === php-html-parser === | ||
+ | |||
+ | https:// | ||
+ | |||
+ | === Goutte === | ||
+ | |||
+ | Goutte is web crawling library for PHP. Goutte fourni un client programmable pour lire et interagir sur des pages html/xml. | ||
+ | |||
+ | http:// | ||
+ | |||
+ | <code php> | ||
+ | // Require the Goutte phar file to use Goutte in a script: | ||
+ | require_once '/ | ||
+ | // Create a Goutte Client instance: | ||
+ | $client = new Client(); | ||
+ | // Make requests | ||
+ | $crawler = $client-> | ||
+ | // Click on links: | ||
+ | $link = $crawler-> | ||
+ | $crawler = $client-> | ||
+ | // Submit forms: | ||
+ | $form = $crawler-> | ||
+ | $crawler = $client-> | ||
+ | //Extract data: | ||
+ | $nodes = $crawler-> | ||
+ | if ($nodes-> | ||
+ | { | ||
+ | die(sprintf(" | ||
+ | } | ||
+ | printf(" | ||
+ | </ | ||
+ | |||
+ | |||
informatique/php.txt · Dernière modification : 08/09/2023 07:41 de cyrille