From b7daa2624d698a2fcf64923b4d1c51d859673006 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Sat, 11 Feb 2023 23:46:33 +0400 Subject: [PATCH] Remove a workaround for old lxml. --- scrapy/http/request/form.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scrapy/http/request/form.py b/scrapy/http/request/form.py index bdc6a3e39..342e0c7ad 100644 --- a/scrapy/http/request/form.py +++ b/scrapy/http/request/form.py @@ -198,12 +198,6 @@ def _select_value(ele: SelectElement, n: str, v: str): # And for select tags without options o = ele.value_options return (n, o[0]) if o else (None, None) - if v is not None and multiple: - # This is a workaround to bug in lxml fixed 2.3.1 - # fix https://github.com/lxml/lxml/commit/57f49eed82068a20da3db8f1b18ae00c1bab8b12#L1L1139 - selected_options = ele.xpath(".//option[@selected]") - values = [(o.get("value") or o.text or "").strip() for o in selected_options] - return n, values return n, v