'Multiple possible values when searching item by XPath | Scrapy

I would like to find title bar icon with rel = 'icon' or 'shortcut icon'.

So I'm trying to do something like this:

response.xpath("head/link[@rel='icon' or 'shortcut icon']/@href").get()

But, unfortunately, it works incorrectly.

So is it possible to combine multiple conditions in such a query?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source