Hi, I have a web page with 30 radio buttons, and I need click only in fourth radio button, named "Solaris". Looking at web page''s source code I cannot see data, because it was made in javascript. Can Mechanize do this task for me ? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120810/4548995b/attachment.html>
Yes, it can handle the job you have to do, but no it wont parse the javascript and build the form for you. You''ll have to figure out what the javascript is doing to the html that''s being posted and do it yourself with mechanize. One handy tool I use heavily for dealing with this type of overcomplicated scrape is WebScarab. I just proxy and capture my browser stepping through what the mechanize script will be stepping through and go through exactly what is being passed back and forth. No matter how complicated they do anything in javascript, or even worse the .asp.net crap pages I have to deal with, response to the service is still a simple html get or put, easily handled with Mechanize. On Fri, Aug 10, 2012 at 8:09 AM, Valdemir Santos <valdemirs at gmail.com>wrote:> Hi, > I have a web page with 30 radio buttons, and I need click only in fourth > radio button, named "Solaris". > Looking at web page''s source code I cannot see data, because it was made > in javascript. > Can Mechanize do this task for me ? > Thanks > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120810/efb304b6/attachment.html>
I always submit the page via browser and so get the data submited, added the form with form.add_field! after only submit the form! On Fri, Aug 10, 2012 at 10:35 AM, Brian Kennedy <sirbeep at gmail.com> wrote:> Yes, it can handle the job you have to do, but no it wont parse the > javascript and build the form for you. You''ll have to figure out what the > javascript is doing to the html that''s being posted and do it yourself with > mechanize. > > One handy tool I use heavily for dealing with this type of overcomplicated > scrape is WebScarab. I just proxy and capture my browser stepping through > what the mechanize script will be stepping through and go through exactly > what is being passed back and forth. > > No matter how complicated they do anything in javascript, or even worse > the .asp.net crap pages I have to deal with, response to the service is > still a simple html get or put, easily handled with Mechanize. > > On Fri, Aug 10, 2012 at 8:09 AM, Valdemir Santos <valdemirs at gmail.com>wrote: > >> Hi, >> I have a web page with 30 radio buttons, and I need click only in fourth >> radio button, named "Solaris". >> Looking at web page''s source code I cannot see data, because it was made >> in javascript. >> Can Mechanize do this task for me ? >> Thanks >> >> _______________________________________________ >> Mechanize-users mailing list >> Mechanize-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mechanize-users >> > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-- Att. Thiago Imolesi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120810/705b8ebe/attachment-0001.html>
Thanks for the answers. I need create an automated checklist filler - 150 radio buttons in web page, like below: for line in bkp_linux bkp_red_hat bkp_alpha bkp_solaris bkp_ibm do (go to the web page and click each radio button named like lines above). On Fri, Aug 10, 2012 at 10:40 AM, Thiago Imolesi <trimolesi at gmail.com>wrote:> I always submit the page via browser and so get the data submited, added > the form with form.add_field! after only submit the form! > > > On Fri, Aug 10, 2012 at 10:35 AM, Brian Kennedy <sirbeep at gmail.com> wrote: > >> Yes, it can handle the job you have to do, but no it wont parse the >> javascript and build the form for you. You''ll have to figure out what the >> javascript is doing to the html that''s being posted and do it yourself with >> mechanize. >> >> One handy tool I use heavily for dealing with this type of >> overcomplicated scrape is WebScarab. I just proxy and capture my browser >> stepping through what the mechanize script will be stepping through and go >> through exactly what is being passed back and forth. >> >> No matter how complicated they do anything in javascript, or even worse >> the .asp.net crap pages I have to deal with, response to the service is >> still a simple html get or put, easily handled with Mechanize. >> >> On Fri, Aug 10, 2012 at 8:09 AM, Valdemir Santos <valdemirs at gmail.com>wrote: >> >>> Hi, >>> I have a web page with 30 radio buttons, and I need click only in fourth >>> radio button, named "Solaris". >>> Looking at web page''s source code I cannot see data, because it was made >>> in javascript. >>> Can Mechanize do this task for me ? >>> Thanks >>> >>> _______________________________________________ >>> Mechanize-users mailing list >>> Mechanize-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/mechanize-users >>> >> >> >> _______________________________________________ >> Mechanize-users mailing list >> Mechanize-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mechanize-users >> > > > > -- > Att. > Thiago Imolesi > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120810/3b68e643/attachment.html>
So you''re not trying to navigate a page for the purposes of automating a task, you''re trying to run a regression test on the site? Wrong tool, don''t stick a screwdriver in that! If you''re testing you''ll want the javascript tested too and Mechanize can''t do that for you. On Fri, Aug 10, 2012 at 10:22 AM, Valdemir Santos <valdemirs at gmail.com>wrote:> Thanks for the answers. > I need create an automated checklist filler - 150 radio buttons in web > page, like below: > > for line in > bkp_linux > bkp_red_hat > bkp_alpha > bkp_solaris > bkp_ibm > do > (go to the web page and click each radio button named like lines above). > > > On Fri, Aug 10, 2012 at 10:40 AM, Thiago Imolesi <trimolesi at gmail.com>wrote: > >> I always submit the page via browser and so get the data submited, added >> the form with form.add_field! after only submit the form! >> >> >> On Fri, Aug 10, 2012 at 10:35 AM, Brian Kennedy <sirbeep at gmail.com>wrote: >> >>> Yes, it can handle the job you have to do, but no it wont parse the >>> javascript and build the form for you. You''ll have to figure out what the >>> javascript is doing to the html that''s being posted and do it yourself with >>> mechanize. >>> >>> One handy tool I use heavily for dealing with this type of >>> overcomplicated scrape is WebScarab. I just proxy and capture my browser >>> stepping through what the mechanize script will be stepping through and go >>> through exactly what is being passed back and forth. >>> >>> No matter how complicated they do anything in javascript, or even worse >>> the .asp.net crap pages I have to deal with, response to the service is >>> still a simple html get or put, easily handled with Mechanize. >>> >>> On Fri, Aug 10, 2012 at 8:09 AM, Valdemir Santos <valdemirs at gmail.com>wrote: >>> >>>> Hi, >>>> I have a web page with 30 radio buttons, and I need click only in >>>> fourth radio button, named "Solaris". >>>> Looking at web page''s source code I cannot see data, because it was >>>> made in javascript. >>>> Can Mechanize do this task for me ? >>>> Thanks >>>> >>>> _______________________________________________ >>>> Mechanize-users mailing list >>>> Mechanize-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/mechanize-users >>>> >>> >>> >>> _______________________________________________ >>> Mechanize-users mailing list >>> Mechanize-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/mechanize-users >>> >> >> >> >> -- >> Att. >> Thiago Imolesi >> >> _______________________________________________ >> Mechanize-users mailing list >> Mechanize-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mechanize-users >> > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120810/93206945/attachment.html>
Hi, It''s not a regression test. I need fill a checklist with 150 radio buttons. Tool needs searching for a string in the web page and click in that radio button. On Fri, Aug 10, 2012 at 11:30 AM, Brian Kennedy <sirbeep at gmail.com> wrote:> So you''re not trying to navigate a page for the purposes of automating a > task, you''re trying to run a regression test on the site? Wrong tool, > don''t stick a screwdriver in that! If you''re testing you''ll want the > javascript tested too and Mechanize can''t do that for you. > > On Fri, Aug 10, 2012 at 10:22 AM, Valdemir Santos <valdemirs at gmail.com>wrote: > >> Thanks for the answers. >> I need create an automated checklist filler - 150 radio buttons in web >> page, like below: >> >> for line in >> bkp_linux >> bkp_red_hat >> bkp_alpha >> bkp_solaris >> bkp_ibm >> do >> (go to the web page and click each radio button named like lines above). >> >> >> On Fri, Aug 10, 2012 at 10:40 AM, Thiago Imolesi <trimolesi at gmail.com>wrote: >> >>> I always submit the page via browser and so get the data submited, added >>> the form with form.add_field! after only submit the form! >>> >>> >>> On Fri, Aug 10, 2012 at 10:35 AM, Brian Kennedy <sirbeep at gmail.com>wrote: >>> >>>> Yes, it can handle the job you have to do, but no it wont parse the >>>> javascript and build the form for you. You''ll have to figure out what the >>>> javascript is doing to the html that''s being posted and do it yourself with >>>> mechanize. >>>> >>>> One handy tool I use heavily for dealing with this type of >>>> overcomplicated scrape is WebScarab. I just proxy and capture my browser >>>> stepping through what the mechanize script will be stepping through and go >>>> through exactly what is being passed back and forth. >>>> >>>> No matter how complicated they do anything in javascript, or even worse >>>> the .asp.net crap pages I have to deal with, response to the service >>>> is still a simple html get or put, easily handled with Mechanize. >>>> >>>> On Fri, Aug 10, 2012 at 8:09 AM, Valdemir Santos <valdemirs at gmail.com>wrote: >>>> >>>>> Hi, >>>>> I have a web page with 30 radio buttons, and I need click only in >>>>> fourth radio button, named "Solaris". >>>>> Looking at web page''s source code I cannot see data, because it was >>>>> made in javascript. >>>>> Can Mechanize do this task for me ? >>>>> Thanks >>>>> >>>>> _______________________________________________ >>>>> Mechanize-users mailing list >>>>> Mechanize-users at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/mechanize-users >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Mechanize-users mailing list >>>> Mechanize-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/mechanize-users >>>> >>> >>> >>> >>> -- >>> Att. >>> Thiago Imolesi >>> >>> _______________________________________________ >>> Mechanize-users mailing list >>> Mechanize-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/mechanize-users >>> >> >> >> _______________________________________________ >> Mechanize-users mailing list >> Mechanize-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mechanize-users >> > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120810/e54163ce/attachment-0001.html>