I am using Mechanize. I can get the particular contents but I
am not getting the expected data. There is a function in javascript
as,
window.onload = function() {
if (location && location.search == "") {
location.replace('/po3/?_d');
} else {
location.replace('/po3/' + location.search + '&_d=1');
};
};
I think this function is not getting called so I am not able to get
the expected data. I want to call this function with Mechanize.
I think this function is not getting called so I am not able to get
the expected data. I want to call this function with Mechanize.
Mechanize can't evaluate javascript. The creator of Mechanize, Aaron Patterson, is working on a new project called RKelly which has the goal of being able to evaluate Javascript in Ruby.
Until then, your only solution is to use Selenium or Watir to control an actual browser.
IIRC scrubyt uses firewatir for similar cases, so you may have better
luck using that. (http://scrubyt.org/\)
···
On Jan 3, 2008 9:24 AM, Kamal Fariz <kamal@ror.com.my> wrote:
> There is a function in javascript
>
> snip
>
> I think this function is not getting called so I am not able to get
> the expected data. I want to call this function with Mechanize.
Mechanize can't evaluate javascript. The creator of Mechanize, Aaron
Patterson, is working on a new project called RKelly which has the
goal of being able to evaluate Javascript in Ruby.
Until then, your only solution is to use Selenium or Watir to control
an actual browser.
> > I think this function is not getting called so I am not able to get
> > the expected data. I want to call this function with Mechanize.
> Mechanize can't evaluate javascript. The creator of Mechanize, Aaron
> Patterson, is working on a new project called RKelly which has the
> goal of being able to evaluate Javascript in Ruby.
> Until then, your only solution is to use Selenium or Watir to control
> an actual browser.