Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. $scrapping_product_url = "https://www.beatsbydre.com/headphones/solo2";
  2. $dom = new DOMDocument();
  3. @$dom->loadHTML('<?xml encoding="UTF-8">'.file_get_contents($scrapping_product_url));
  4. if ($dom->validate()) {
  5. echo "This document is valid!n";
  6. }
  7. else {
  8. echo "invalid";
  9. }
  10. //var_dump($dom->saveHTML());
  11.  
  12. $xpath = new DOMXpath($dom);
  13.  
  14. $initial_list = $xpath->query("//div[@class='pdp-module-12 pdp-module']/div[@class='container']/div");
  15. echo " initial list ";print_r($initial_list);exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement