$("br",top.document).parent().contents().each(function() {
textx = this.textContent.replace(/s+/g, )
if ( this.nodeType == 3 && textx.length ) {
$(this).wrap( <div id="uniqja__ + numero + "></div> )
}
})
怎样才能将这一信息转化为无烟吗?
原标题:how can i translate this into ruby nokogiri?
最佳回答
也许有这样的东西?
require rubygems
require nokogiri
doc = Nokogiri::HTML(your_html)
top_document = doc.xpath("//path_to_an_element")
top_document.
xpath("//*[br]/text()[string-length(normalize-space()) != 0]").
wrap("<div id="uniqja__#{numero}"></div>")
问题回答
暂无回答
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding