-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submit form with no button #403
Comments
Sorry for the excessively slow reply to this issue! I see your point about having no way to specify that no submit button should be simulated. If this is still relevant to you, we can certainly consider an enhancement here. Maybe the simplest thing would be to skip selecting a submit if if btnName is not False:
self.form.choose_submit(btnName) You can also use |
@hemberger Thanks for getting back to me. Yes, I'd certainly still be keen to see this feature implemented. The way you've suggested seems like a very simple change, and would no doubt work for me. |
If you have time to work on it, pull-requests are welcome (the code itself should be straightforward, but there should be a test which may require a bit more time to write). We may get time to implement it ourselves, but at least I have very limited time for MechanicalSoup :-(. |
@moy Okay, sure. |
Some web pages use JavaScript postbacks to submit forms. This means that a submitted form has nothing to do with which button is pressed. In fact, including form data for the "pressed" button can mess things up in such a case.
Accordingly, it would be great to have a way of specifying that no button "press" should be simulated when calling
submit_selected
. Right now,btnName = None
means that the first "submit" button is auto-selected — but there is no way to specify that no submit button press should be simulated. Perhaps another (boolean) parameter could be used for this? TheForm.choose_submit
method would also need to be enhanced accordingly.The text was updated successfully, but these errors were encountered: