PHP DOM parser function

Ακυρώθηκε Αναρτήθηκε Πριν 7 χρόνια Πληρώθηκε κατά την παράδοση
Ακυρώθηκε Πληρώθηκε κατά την παράδοση

I need a PHP function which can parse HTML string, search for specific selector path, and return the content of all matched elements. The function will be called parse() and will accept two arguments, as defined: function parse(&$html, $selector). Return value will be array of found code blocks.

The $html parameter will be a complete webpage HTML string. Remember it may be not-perfectly-valid HTML.

The $selector parameter will be a string of space-separated selectors which create full path to one or more subsections of the $html string. For example, $selector can be as simple as "#myelement", which matches everything inside <tag id="myelement">..</tag>

Similarly the selector can be as simple as ".className", which will match all tags with className in "class" attribute, so even <div class="otherClassName className">...</div>

Also the $selector can be more complicated expression, like "[url removed, login to view] [url removed, login to view]"

The above mentioned example selector will match the first and third block in this HTML:

<div class="className1 className2 classNameX"><span class=cls>xxx</span></div>

<div class="className2 className1 classNameX"><span>yyy</span></div>

<div class="classNameX className2 className1"><span class=cls>z<b>z</b>z</span></div>

Return value will be an array with all the subsections of the $html string as matched by the $selector. Pure HTML returned, no objects. So for our example example, with the above mentioned selector and html code, return value will be this array: ["xxx", "z<b>z</b>z"]

You are not allowed to use any external PHP libraries, only use PHP's native functions.

HTML5 PHP

Ταυτότητα Εργασίας: #11509192

Σχετικά με την εργασία

6 προτάσεις Απομακρυσμένη εργασία Ενεργό Πριν 7 χρόνια

6 freelancers κάνουν προσφορές κατά μέσο όρο $30 για αυτή τη δουλειά

Sonicoders

I have 6 years experience as web developer I can provide you the solution we can discuss more details over chat.

$25 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0
Anthony773

hello, I am a php programmer, I have wirtten a similar parser using the library SimpleHtmlDomparser, that recursively parses a series of webpages, depending on the arguments passed to it. Well, using pure php functions Περισσότερα

$27 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0
richardalozada

Hi I would like to help make this project I am an expert in this field

$30 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0