An Interest In:
Web News this Week
- March 1, 2024
- February 29, 2024
- February 28, 2024
- February 27, 2024
- February 26, 2024
- February 25, 2024
- February 24, 2024
April 15, 2022 09:58 pm GMT
Original Link: https://dev.to/pikashow5/scrape-any-links-from-websites-5bnf
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To