0

In my scraping project I encountered a data point containing a string in the following form

string = "d%61b%69a%5f%62%65%79@yaho%6f.fr"
target_string = dabia_bey@yahoo.fr

What encoding change should I do to wrongly encoded strings? How can I scrape these broken strings correctly?

Thank you

avakado0
  • 101
  • 1
  • 9

1 Answers1

1

you need urllib unquote

>>> from urllib.parse import unquote
>>> unquote("d%61b%69a%5f%62%65%79@yaho%6f.fr")
'dabia_bey@yahoo.fr'
ti7
  • 16,375
  • 6
  • 40
  • 68