You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, since the change it will silently skip errors due to the element not being at the root / a direct child of the form element.
Changing the code to form_input.getparent().remove(form_input) fixes that, but has the downside of changing the form as a side-effect (i.e. serializing it twice has a different outcome).
Serializing a form is meant to remove inputs of type submit, so that they are not sent: https://github.com//cobrateam/splinter/blob/c04a75dede7f314bba69a7ff188c147417647b12/splinter/driver/lxmldriver.py#L50-L60 (changed in https://github.com//cobrateam/splinter/commit/ad28ab4aeb56cde66a20e67cb3261324eecebeec (#611, for #595)).
However, since the change it will silently skip errors due to the element not being at the root / a direct child of the form element.
Changing the code to
form_input.getparent().remove(form_input)
fixes that, but has the downside of changing the form as a side-effect (i.e. serializing it twice has a different outcome).Note that lxml provides helpers to submit a form (https://github.com/lxml/lxml/blob/50c276412880c1a3dde8a6d6c909e3ed8ef47e43/src/lxml/html/__init__.py#L1081-L1116), and getting a form's values specifically (https://github.com/lxml/lxml/blob/50c276412880c1a3dde8a6d6c909e3ed8ef47e43/src/lxml/html/__init__.py#L1011-L1041), which should be used here instead probably.
As a workaround I've used this now:
The text was updated successfully, but these errors were encountered: