DEV Community

Cover image for HTML Dom Parser to find all links
pikasho
pikasho

Posted on

HTML Dom Parser to find all links

First of all you need to download html dom parser file from sourceforge. Then this code will work for you best.
Here is the code you can find all links and text in the Free Fire Apk url.

PHP Code

<?php
include('simplehtmldom/simple_html_dom.php');

// Create DOM from URL or file
$html = file_get_html('https://freefireapk.download/');

// Find all links, and their text
foreach($html->find('a') as $elm) {
echo $elm->href .' ('.$elm->plaintext. ')
';
}
?>

Top comments (0)