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.
amount = re.findall(r'Above \xC2 (.*?) =', html)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.