Skip to content

Commit

Permalink
browser.py: add StatefulBrowser note in submit docstring
Browse files Browse the repository at this point in the history
This docstring note is a necessary (but probably not sufficient)
change to `Browser.submit` to prevent it from being used in an
inappropriate way from a `StatefulBrowser` instance.

See MechanicalSoup#230 and MechanicalSoup#233 for more info.
  • Loading branch information
hemberger committed Sep 7, 2018
1 parent 149ef43 commit c2b0b4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mechanicalsoup/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def _request(self, form, url=None, **kwargs):
def submit(self, form, url=None, **kwargs):
"""Prepares and sends a form request.
NOTE: To submit a form with a :class:`StatefulBrowser` instance, it is
recommended to use :func:`StatefulBrowser.submit_selected` instead of
this method so that the browser state is correctly updated.
:param form: The filled-out form.
:param url: URL of the page the form is on. If the form action is a
relative path, then this must be specified.
Expand Down

0 comments on commit c2b0b4a

Please sign in to comment.