Created
May 11, 2016 15:25
-
-
Save kaynenh/319673575792e583bd8a4d4c5ec248f0 to your computer and use it in GitHub Desktop.
Shell concept for removing node from loaded html
This file contains 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
$string = "<<<HTML" . $this->remoteResponse->getBody() . " | |
HTML"; | |
$dom = new DOMDocument(); | |
$dom->loadHTML($string); | |
$xpath = new DOMXpath($dom); | |
$nlist = $xpath->query("//button[@id='id-of-button']"); | |
$node = $nlist->item(0); | |
$node->parentNode->removeChild($node); | |
var_dump($this); | |
$this->setBody($dom->saveHTML()); | |
//echo $this->remoteResponse->getBody(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment