Ranga Sarin Ranga Sarin - 1 year ago 131
HTML Question

Python encode string to html

How would one take a string and encode special characters to html?

for example, if I have "test@test" how would I encode it so it becomes "test%40test"

Is there an easy way of doing this instead of using replace to manually list every one I want to replace?

Answer Source

Try urlencodefunction. Documentation here.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download