diff --git a/delver/forms.py b/delver/forms.py index 2732a5e..e3c37b2 100644 --- a/delver/forms.py +++ b/delver/forms.py @@ -131,20 +131,14 @@ def action_url(self): :return: str """ action_url = self.action - return urljoin( - self._url if urlparse(action_url).scheme else '', - self.action - ) + return urljoin(self._url if urlparse(action_url).scheme else '', action_url) def has_fields(self, fields): """Return ``True`` if all fields are present :return: bool """ - for field in fields: - if field not in dict(self._lxml_form.inputs): - return False - return True + return all(field in dict(self._lxml_form.inputs) for field in fields) def __getattr__(self, item): """Wraps some chosen methods (PARENT_METHODS) from ``lxml.html.FormElement`` diff --git a/delver/helpers.py b/delver/helpers.py index 0f26e97..16c1d42 100644 --- a/delver/helpers.py +++ b/delver/helpers.py @@ -109,7 +109,7 @@ def process_row(): headers.append(row_child.text_content()) elif row_child.tag == 'td': if headers[subindex] in colspans: - if not headers[subindex] in table_dict[index]: + if headers[subindex] not in table_dict[index]: table_dict[index][headers[subindex]] = [row_child.text_content()] else: table_dict[index][headers[subindex]].append(row_child.text_content())