I am using PHP simple DOM parser but it does not seem to have the functionality to search for text. I need to search for a string and find the parent id for it. Essentially
Just imagine that any tag has a "plaintext" attribute and use standart attribute selectors.
So, HTML:
London is the capital of Great Britain
Washington is the capital of the USA
can be imagined in mind as:
London is the capital of Great Britain
Washington is the capital of the USA
And PHP to resolve your task is just:
London is the capital of Great Britain
(take in mind that "plaintext" for tags is right-padded with a space symbol; this is default behaviour of Simple HTML DOM, defined by constant
DEFAULT_SPAN_TEXT
)