Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何从数据中删除空格?_Python_Html_Dictionary_Web Scraping - Fatal编程技术网

Python 如何从数据中删除空格?

Python 如何从数据中删除空格?,python,html,dictionary,web-scraping,Python,Html,Dictionary,Web Scraping,我是一名新的python开发人员,对字典有点问题。当我试图从网站上抓取字典的数据时,数据中有空格,例如,为了澄清,我试图抓取“ref”之前的数字 因此,我的问题是如何在A'类文本> p>之前和之后删除空白空间,您的PNG显示空间位于URL中。我会用 unquote(字符串) 你试过strip()然后split()吗?@Shane有用,但不是OP想要的。

我是一名新的python开发人员,对字典有点问题。当我试图从网站上抓取字典的数据时,数据中有空格,例如,为了澄清,我试图抓取“ref”之前的数字


因此,我的问题是如何在A'类文本

> p>之前和之后删除空白空间,您的PNG显示空间位于URL中。我会用

unquote(字符串)


你试过
strip()
然后
split()
吗?@Shane有用,但不是OP想要的。