Add variable in HtmlXPathSelector select function
Use str.format to insert variable value into xpath expression:
sel.select('//a[contains(@href, "{0}")]/@href'.format(url_type)).extract()
Instead of "rss", I want to add a global variable to it. So that I don't have to change it again and again.
sel.select('//a[contains(@href, "rss")]/@href').extract() to something like this:
sel.select('//a[contains(@href, url_type)]/@href').extract()