You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ProductPage(Item):
coupon = Attr('.coupon', 'title')
However some product pages do not contain the coupon html
so they fail with
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/htmlparsing.py", line 79, in parse
return element.css(self.selector)[0].attrs[self.attr]
IndexError: list index out of range
What's the best practice to deal with that situation?
The text was updated successfully, but these errors were encountered:
I use:
However some product pages do not contain the coupon html
so they fail with
What's the best practice to deal with that situation?
The text was updated successfully, but these errors were encountered: