Reply to Re: In search of a span of class.

Your name:

Reply:


Posted by Paul Lautman on 12/17/19 11:55

R. Rajesh Jeba Anbiah wrote:
> Paul Lautman wrote:
>> Within a subsection of an HTML document (not a complete page), there
>> will be a few spans with the class "room_headings"
>> e.g.
>> <span class="room_headings"> Double
>> Room</span>
>>
>> Can folks suggest some nice ways of extracting all the text contents
>> of such spans into a list (for use in a drop-down select list)?
>
> XPath can be used if the contents are valid XML:
> $xml = new SimpleXMLElement( '<foo><span
> class="room_headings">DoubleRoom</span> <span
> class="room_headings">DoubleRoom</span><span
> class="room_headings1">DoubleRoom</span></foo>');
> print_r($xml->xpath('//span[@class="room_headings"]'));

Sadly I doubt that they are valid XML. They are a middle section of an HTML
page. The normal HTML page header tags will not be present either.

I was wondering if there was a good preg call that could accomplish it?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация