Re: how do I extract the ID name of a Div and its content?
- From: Brian Candler <b.candler@xxxxxxxxx>
- Date: Fri, 12 Dec 2008 06:57:40 -0500
Hans Wurst wrote:
but I tried for 3hours and don`t know how :-(
So, what approach or approaches did you try? What was the solution that
got closest to what you were trying, and what did it output?
There are a whole host of ways you might be approaching this. For
example, you might be using the Hpricot (HTML parsing) library, or REXML
(XML parsing), or simple regular expression matching.
If all you want is the bits between 'single quotes' then a regular
expression match is probably easiest. Try using String#scan, and give it
a regular expression which matches a single quote followed by any number
of non-single-quote characters followed by a single quote.
Or you could use use String#split("'") and keep only the odd-numbered
elements of the returned array.
I'm sure if you post your actual code and what it does, someone will
help you tweak it to work.
--
Posted via http://www.ruby-forum.com/.
.
- References:
- how do I extract the ID name of a Div and its content?
- From: Hans Wurst
- how do I extract the ID name of a Div and its content?
- Prev by Date: Re: Need help with rubyw
- Next by Date: Re: User Prompt as a pop up - not IRB/command line?
- Previous by thread: Re: how do I extract the ID name of a Div and its content?
- Next by thread: Need help with rubyw
- Index(es):
Relevant Pages
|