1

I am working on web scraping project and all working well using PHP Simple HTML DOM Parser. But how to get HTML element inside commented area <!-- *** -->. The way we access <a> like using find method $html->find('a').

I have searched a lot of tutorial but no luck.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
alwDev
  • 11
  • 1
  • Simple HTML DOM parser? I don't know much about that but after looking it up it doesn't look like it's actively maintained. Maybe you're better off using PHP's inbuilt DOMDocument which can be configured to make cdata blocks and comments available. – GordonM Feb 22 '17 at 09:21

1 Answers1

0

I couldn't find any method in the documentation. try using preg_match

preg_match_all("/<!--.*?-->/ms", $foo); 
new_one
  • 142
  • 1
  • 2
  • 10