Hi,
I'm looking the way of searching an string in a HTML file given the URL.
The parameter will be "<span>value</span>" ... it has to be that
format, exactly.
I'm trying with Hpricot (http://code.whytheluckystiff.net/hpricot)
which is very powerfull ... but it searches for elements, so i only
can pass the value of the SPAN .. no the whole string.
anyway of searching for an string in a html file given the URL?
Will this do it? (I have not run it, so there may be errors.)
require 'open-uri'
uri = URI.parse('http://whatever')
data = uri.read
data.scan('<sub>whatever</sub>')
···
On 9/22/06, Jean Verger <jean.verger@gmail.com> wrote:
Hi,
I'm looking the way of searching an string in a HTML file given the URL.
The parameter will be "<span>value</span>" ... it has to be that
format, exactly.
I'm trying with Hpricot (http://code.whytheluckystiff.net/hpricot\)
which is very powerfull ... but it searches for elements, so i only
can pass the value of the SPAN .. no the whole string.
anyway of searching for an string in a html file given the URL?
Hello there,
I am a newbie to Ruby and Watir.
Currently, me trying to extract a parameter from the html page. But the
Value I am trying to extract keeps changing and depends on the input.
Here is the piece of code I tried which did not work...
On 9/28/06, Madu Nar <bharadwaj.n@gmail.com> wrote:
Jean Verger wrote:
> thanks ... simple and efficient it works
>
> thanks,
>
> Jean
Hello there,
I am a newbie to Ruby and Watir.
Currently, me trying to extract a parameter from the html page. But the
Value I am trying to extract keeps changing and depends on the input.
Here is the piece of code I tried which did not work...
On execution the program gives me the following errors...
frame error in wait document
OLE error code:8007005 in <unknown>
Access is denied
HRESULT error code:0x8002009
Exception Occured
Me not sure how to get rid of this. It works till opening the requested
page but finding and writing part does not seem to work...
any more suggestions?
dont know those errors ..., you can troubleshoot ...
make sure that "open(url1)" it is not givin you an error .. If that
line is giving you an error, it means the web site doesn't exist or
you are including the open-uri code ( include 'open-uri.rb (i believe
is the line)
regards,
Jean
···
On 9/28/06, Madu Nar <bharadwaj.n@gmail.com> wrote:
On execution the program gives me the following errors...
frame error in wait document
OLE error code:8007005 in <unknown>
Access is denied
HRESULT error code:0x8002009
Exception Occured
Me not sure how to get rid of this. It works till opening the requested
page but finding and writing part does not seem to work...
any more suggestions?