Parse HTML and Get All h3's After an h2 Before the Next h2 Using PHP
问题 I am looking to find the first h2 in the article. Once found, look for all h3's until the next h2 is found. Rinse and repeat until all headings and subheadings have been located. Before you immediately flag or close this question as duplicate parsing question, please take note of the question title , as for this isn't about basic node retrieval. I've got that part down. I am using DOMDocument to parse HTML using DOMDocument::loadHTML(), DOMDocument::getElementsByTagName() and DOMDocument: