Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $xpath = '/html/body/div/div/div[5]/div/div/div[2]/div/div[2]/img';
- $html = new DOMDocument();
- @$html->loadHTMLFile($target_URL);
- $xml = simplexml_import_dom($html);
- $source_image = $xml->xpath($xpath);
- $source_image = $source_image[0]['src'];
- $xpath = '/html/body/div/div/div[5]/div/div/div[2]/div/div[2]/img';
- $html = new DOMDocument();
- @$html->loadHTMLFile($target_URL);
- $xml = simplexml_import_dom($html);
- if (!$xml) {
- echo 'Error while parsing the document';
- exit;
- }
- $source_image = $xml->xpath($xpath);
- $source_image = $source_image[0]['src'];
Add Comment
Please, Sign In to add comment