本文整理汇总了Python中w3af.core.data.parsers.utils.form_params.FormParameters.set_autocomplete方法的典型用法代码示例。如果您正苦于以下问题:Python FormParameters.set_autocomplete方法的具体用法?Python FormParameters.set_autocomplete怎么用?Python FormParameters.set_autocomplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类w3af.core.data.parsers.utils.form_params.FormParameters
的用法示例。
在下文中一共展示了FormParameters.set_autocomplete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _handle_form_tag_start
# 需要导入模块: from w3af.core.data.parsers.utils.form_params import FormParameters [as 别名]
# 或者: from w3af.core.data.parsers.utils.form_params.FormParameters import set_autocomplete [as 别名]
def _handle_form_tag_start(self, tag, tag_name, attrs):
"""
Handle the form tags.
This method also looks if there are "pending inputs" in the
self._saved_inputs list and parses them.
"""
SGMLParser._handle_form_tag_start(self, tag, tag_name, attrs)
method = attrs.get('method', 'GET').upper()
action = attrs.get('action', None)
form_encoding = attrs.get('enctype', DEFAULT_FORM_ENCODING)
autocomplete = attrs.get('autocomplete', None)
if action is None:
action = self._source_url
else:
action = self._decode_url(action)
try:
action = self._base_url.url_join(action,
encoding=self._encoding)
except ValueError:
# The URL in the action is invalid, the best thing we can do
# is to guess, and our best guess is that the URL will be the
# current one.
action = self._source_url
# Create the form object and store everything for later use
form_params = FormParameters(encoding=self._encoding,
method=method,
action=action,
form_encoding=form_encoding,
attributes=attrs,
hosted_at_url=self._source_url)
form_params.set_autocomplete(autocomplete)
self._forms.append(form_params)
# Now I verify if there are any input tags that were found
# outside the scope of a form tag
for input_attrs in self._saved_inputs:
# Parse them just like if they were found AFTER the
# form tag opening
self._handle_input_tag_inside_form(tag, 'input', input_attrs)
# All parsed, remove them.
self._saved_inputs = []