I am new to using mechanization and even Ruby in general. I use it to navigate a site with poorly distorted HTML. In particular, I have a page with checkboxes outside the form (despite this, the server handles requests well).
I would like to check these fields and click the submit button (also outside the form). However, I canโt use Form.checkbox_withit because I donโt have an object Form, I only have it Page. I can check the box on the page with page.search("//input[@name='silly-checkbox']"), but as far as I understand, I can not check it after (because Nokogiri is used only for cleaning and does not track the status). Please let me know if this is not true.
Bottom line . How can I get an object Mechanize::Form::Checkboxwhen my checkbox is not in form?
source
share