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
Post a Comment