This articles shows how to get HTML source of a URL, even if the URL uses tricks to prevent you from viewing the source.
Extract HTML Source Code of a url using php, How to fetch html source code of a any website from url using php?, fetch html source code by url in php
It is very easy to get his html source from any website. You can do this very easily through the function of php. I will tell you 3 ways to get html source code.
Solution 1:
1 2 3 4 5 6 7 |
<?php $data = file_get_contents("https://www.lipsum.com/"); $html_sourcecode_get = htmlentities($data); echo $html_sourcecode_get; ?> |
Solution 2:
1 2 3 4 5 6 |
<?php $data = file_get_contents('https://www.lipsum.com/'); echo htmlspecialchars($data); ?> |
Solution 3:
1 2 3 4 5 6 7 8 9 10 |
<?php $u = "https://www.lipsum.com/"; $ch = curl_init($u); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); $newquery = curl_exec($ch); echo $newquery_get = htmlentities($newquery); ?> |