开发者

Python URL Characters

开发者 https://www.devze.com 2022-12-20 07:22 出处:网络
I really new to Python and coding in general, but I have been making some good strides. I am able to pull some data off of the web through an API, and the result should be a string.What I am seeing t

I really new to Python and coding in general, but I have been making some good strides.

I am able to pull some data off of the web through an API, and the result should be a string. What I am seeing though, are some instances such as "& amp;"" and " &quot". (I modified the character sets so it would print properly to the screen)

I figure there is a way to clean this string and remove the characters such that it looks like it does on a computer screen. I tried searching for urldecoding, but admittedly I dont even know if that is the solution.

Any help on how to remove these "extra" ch开发者_StackOverflow中文版aracters and produce a readable string will be greatly appreciated!

Many thanks in advance,

Brock


xml.sax.saxutils.unescape(data[, entities]): Unescape '&amp', '&lt', and '&gt' in a string of data.

You can unescape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. '&amp', '&lt', and '&gt' are always unescaped, even if entities is provided.

0

精彩评论

暂无评论...
验证码 换一张
取 消