I am using this selector but it is giving error
//*[@id="quantity"]/option/[last()-1]
How do I select last OPTION?
I am using Scrapy Framework.
I am using this selector but it is giving error
//*[@id="quantity"]/option/[last()-1]
How do I select last OPTION?
I am using Scrapy Framework.
You have an extra
/
before the[
making the XPath expression invalid. Remove it:Note that you can also solve it using Python/Scrapy:
Or, in a CSS selector form: