you can use this simple html dom parser for your needs
Curl specific div tag, till all the contents are fetched
-
23-06-2023 - |
Domanda
here I want to ask a question regarding curl. I have a url, this could be anything, in which I have to curl specific div, with the help of regex and preg_match. Currently I use the following regex:
$regex = '/\<div id=\'main\'\>(.*?)<\/div\>/is';
This fetched all the contents of this div, but the problem is here. When there are many nested div, inside this 'main' div, then if there any other closing div tag appeared , than this would stop curling.
What I need is, fetching div, till all the contents of this particular div are fetched and then stopped curling, not when there appeared any other closed div tag.
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow