From: Paul Lutus Date: 2006-12-13T19:35:05+09:00 Subject: Re: hpricot selective text modification Siddharth Karandikar wrote: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/207625 > is an answer to most of my requirements, except one. > > How can I do a selective traverse_text so that I can skip text of > specific tags? / ... snip lengthy listing of Hpricot error messages > Am I making any mistake? Rather than describe the problems you are having trying to make Hpricot deliver a particular result, why not say what you are trying to accomplish and we can discuss that instead? Parsing and extracting particular text from syntactically correct HTML pages is relatively easy. It only requires a few lines of Ruby code. You can choose which tags to extract text from, and leave all the others behind. In some cases, it is simpler to write your own extraction code than to try to get a library to do this for you. But this approach requires that the HTML pages be reasonably error-free -- it doesn't work very well if there are errors in the syntax of the source pages. If the pages you have to parse are reasonably error-free, you may have a much easier time getting what you are after than you may think at this point. -- Paul Lutus http://www.arachnoid.com