ruby - wrapping elements with nokogiri? -


एक xpath दी

आप ऐसा कुछ कर सकते हैं

  Doc.xpath ("/ html / body / a")। रैप ("& lt; span & gt; & lt; / span & gt;")  

और स्पैन टैग के साथ सभी लिंक लपेटें?

  doc.xpath ('/ html / body / a')। प्रत्येक {| a | A.swap ("& lt; span & gt; # {a} & lt; / span & gt;"}}  

बेहतर समाधान मिला (@ फ़्राँग के अनुसार संपादित करें)

 < कोड> डॉक्टर खोज ('ए')। रैप ('& lt; span / & gt;')  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -