Class DOMDocument does not contains method getElementsByClassName
Use xpath
$xpath = new DOMXpath($dom);
$xpath->query('//div[contains(@class, "localImage")]'); //instance of DOMNodeList
More Related Contents:
- Remove a child with a specific attribute, in SimpleXML for PHP
- How to extract a node attribute from XML using PHP’s DOM Parser
- Simplify PHP DOM XML parsing – how?
- Getting node’s text in PHP DOM
- Printing content of a XML file using XML DOM
- How do I iterate through DOM elements in PHP?
- PHP XML inserting element after (or before) another element
- Save output in an xml file [closed]
- Search through XML using PHP [duplicate]
- How to get innerHTML of DOMNode?
- A simple program to CRUD node and node values of xml file [closed]
- Simple XML – Dealing With Colons In Nodes
- Forcing a SimpleXML Object to a string, regardless of context
- Parsing Huge XML Files in PHP
- Parse XML with Namespace using SimpleXML [duplicate]
- How to resolve cURL Error (7): couldn’t connect to host?
- How to parse SOAP XML?
- How to get the value of an attribute from XML file in PHP?
- How to insert HTML to PHP DOMNode?
- PHP namespace simplexml problems
- Regexp to add attribute in any xml tags
- How do I capture PHP output into a variable?
- Using SimpleXML to read RSS feed
- How to echo XML file in PHP
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- SimpleXML: Working with XML containing namespaces
- Loop through an XML object with SimpleXML
- How do I see the actual XML generated by PHP SOAP Client Class?
- Remove & from string when writing to xml in PHP
- How to parse SOAP response without SoapClient