Created
January 20, 2015 02:09
-
-
Save sagive/5b6d3e97ad92102a67ed to your computer and use it in GitHub Desktop.
Example - mixing it toghter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include('../functions/browser-agent.php'); | |
include('../functions/strings.php'); | |
include('../functions/curl-helper.php'); | |
// ADD BROWSER EMULATION TO FILE GET CONTENT | |
$useragent = get_random_useragent(); | |
// SCRAPE THE DESIRED PAGE | |
$clnUrl2Chk = normalize_url($urltocheck); | |
$html = curl_download($urltocheck, $clnUrl2Chk, $useragent); | |
$dom = new DOMDocument; | |
@$dom->loadHTML($html); | |
$links = $dom->getElementsByTagName('a'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment