Open dubiousjim opened 9 years ago
I think OKCupid changed their html recently. This issue only showed up with a few profiles (out of 1000s).
Also, I just now came across a profile where p.looking_for.raw_fields['ages']
was ' Age 41 '
. This can be accommodated by adding:
_ages_re2 = re.compile(u' *Age ([0-9]{1,3})')
near the top of looking_for.py
, and editing the definition of ages
later in that file like this:
def ages(self):
"""The age range that the user is interested in."""
match = self._ages_re.match(self.raw_fields.get('ages'))
+ if not match:
+ match = self._ages_re2.match(self.raw_fields.get('ages'))
+ return self.Ages(int(match.group(1)),int(match.group(1)))
return self.Ages(int(match.group(1)), int(match.group(2)))
Cool, nice finds. Do you have an example profile that this happens with
Do you want to make a pull request? I'm happy to fix things I guess if not, but it would be greatly appreciated.
Ehh, I don't want to publish my own copy of the repository just for a few tiny patches. I can email you patches if you prefer.
Changing line 34 of
looking_for.py
from:to:
seems to fix it.