Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. $html = file_get_contents('https://tv-sewingcenter.com');
  2. $dom = new DOMDocument;
  3. libxml_use_internal_errors(true);
  4. $dom->loadHTML($html);
  5. $scripts = $dom->getElementsByTagName('script');
  6. if( ! empty( $scripts ) )
  7. {
  8.     foreach( $scripts as $script )
  9.     {
  10.         if( $script->hasAttribute('type') && $script->getAttribute('type') == 'application/ld+json' )
  11.         {
  12.             echo $script->nodeValue;
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement