headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.49k stars 160 forks source link

Is it possible to submit form if any form field has no "name" attribute? #71

Closed ellisonleao closed 5 years ago

ellisonleao commented 7 years ago

Since the current implementation uses the field's name attribute to create the url.Values , which is correct from the W3C standards, is it maybe possible to submit a form event if the field has no name attribute?

Say we have this

<form class='some-form'>
        <textarea id='someid'></textarea>
       <button id='someid' type="button" onclick="someJSsubmit()"></button>
</form>

Is it possible that i could populate the textarea and click the button after?

arpitjindal97 commented 7 years ago

I have form with name attribute but it isn't detected Here is my website

masiqbal commented 7 years ago

You may try:

fm, _ := bow.Form("form.some-form") fm.Input("textarea#someid", "your desired value") if fm.Submit() != nil { panic(err) }

gauravagnihotri commented 6 years ago

I can confirm that I had similar issue.