Skip to content

Instantly share code, notes, and snippets.

@rafikahmed
Created February 28, 2020 18:02
Show Gist options
  • Save rafikahmed/11c04009315e18a6d017dc3572fb0403 to your computer and use it in GitHub Desktop.
Save rafikahmed/11c04009315e18a6d017dc3572fb0403 to your computer and use it in GitHub Desktop.
def strip_output(self, input):
try:
return input.strip()
catch NoneType:
return ""
def parse(self, response):
yield {
"target_field": self.strip_output(response.xpath('//label[contains(text(),"Founded:")]/following-sibling::p/text()').get())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment