I am web-scraping some stuff and i got something like this “735 πππππππ π πΌππππππππ’ π±πππ, π³πππππππππ, πΌπ° 02122 Dorchester MA 02121” how do i convert it to normal text in python?
Advertisement
Answer
You can run it through Unicode normalization:
import unicodedata unicodedata.normalize('NFKD', '735 πππππππ π πΌππππππππ’ π±πππ, π³πππππππππ, πΌπ° 02122') # '735 William T Morrissey Blvd, Dorchester, MA 02122'
Here’s a REPL screenshot that demonstrates it works: