Ruby mechanize clicking divs -


i'm trying search page divs containing specific class , click on them. each of these divs containing class have onclick event on them.

my current code looks so,

home_page = agent.get('http://mysite.com')  home_page.search(".//div[@class='arrow up']").each |i|    i.click end 

the div looks on website.

<div class="arrow up" onclick="$(this).uparrow(u.config.places, null, event)" role="button" aria-label="uparrow" tabindex="0"></div> 

now there no click method because nokogiri object, here ask possible mechanize click on div this? current code can find divs match class name, cannot figure out how click on it.

no there's no way that. need @ onclick attribute , try figure out it's doing. or use watir.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -