I was wondering if anyone can help me store a string then use it else here in a different definition.
so lets say for example,
<html>
<body>
<div id="example">
143453
</div>
</body>
</html>
How could I store the number 143453 as a string, so I can use it elsewhere?
Simply ask for the text of the element and store it in a variable:
Another way is to use an HTML parser, such as Nokogiri. If you do a lot of parsing, this may provide extra speed. Somewhere you’ll need to
require 'nokogiri'then you can do this: