Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 15, 2022 09:58 pm GMT

Scrape any links from websites

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 Yacine TV.

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

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

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


Original Link: https://dev.to/pikashow5/scrape-any-links-from-websites-5bnf

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To