1

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?

1

1 Answer 1

2

Try urlencodefunction. Documentation here.

https://docs.python.org/2/library/urllib.html#urllib.urlencode

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.