Python:NameError: name 'null' is not defined,pythonnameerror,问题代码html =""
Python:NameError: name 'null' is not defined,pythonnameerror,问题代码html =""
问题代码
html ="""["http:\/\/weibo.com\/2084584685",10,null,null,false,true,0]"""
html = eval(html)
报错
NameError: name 'null' is not defined
注
html是采集后从源码中获取的,除了给null,false,true添加双引号以外,还有其他解决办法吗?
编橙之家文章,
相关内容
- 为什么 PHP 的`preg`要求正则有分隔符?,preg分隔符,难道
- 当client端JS返回false是,如何让页面redirect到一个新页面
- [python] globals()['Foo']=value 和 setattr(module, 'Foo', val,glob
- 用python编写微信公共平台的后台如何在用户关注之后自
- Python:如何解析这个页面呢?,python解析页面,请问,使
- Django不同app之间相互import,是否破坏其“松耦合”的原
- python 中有类似 C++ 中 const reference 的用法吗?,pythonc
- scrapy 使用item export输出中文到json文件,内容为unicode码
- Python:from scrapy.http import Request,pythonscrapy.http,环境:
- MongoDB/Mongoengin 如果设计一个课程表字段,mongodbmongoen
评论关闭