2

I'm having a bit of trouble with a regular expression in python. The html string is:

html = <td style="padding-right:5px;">
<span class="blackText">Above £ 7.00 = </span>
</td>
<td>
<span class="blackText">
<p>Free</p>
</span>
</td>

I want to extract the "7.00" and "Free", however the following does not work:

amount = re.findall(r'Above £ (.*?) =',html)

Python throws up a non-ASCII error for the £ symbol. How would I get around this? Thanks.

eamon1234
  • 1,555
  • 3
  • 19
  • 38
  • http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags – unddoch Nov 29 '12 at 19:48

1 Answers1

5
amount = re.findall(r'Above \xC2 (.*?) =', html)
Ωmega
  • 42,614
  • 34
  • 134
  • 203