运行JS.call时报AttributeError: 'NoneType' object has no attribute 'replace'
时间: 2023-08-22 21:06:22 浏览: 103
AttributeError: ‘NoneType’ object has no attribute ‘children’ 错误
5星 · 资源好评率100%
运行JS.call时报AttributeError: 'NoneType' object has no attribute 'replace'这个错误可能是因为在调用JS的call()方法时,参数中的某个对象是None类型,并且该对象没有replace()方法。一种可能的解决方法是检查参数对象是否正确传递,并确保它不是None类型。你可以使用断点或打印语句来查看参数对象的值并确定问题所在。另外,你还可以检查执行JS脚本的文件是否正确加载,并确保文件中包含了replace()方法的定义。如果文件没有加载或者没有定义replace()方法,也会导致此错误的出现。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [execjs 模块 call() 方法报错 AttributeError: ‘NoneType‘ object has no attribute ‘replace](https://blog.csdn.net/lyugd_dd/article/details/127054249)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Python爬虫执行js代码时报错:AttributeError: ‘NoneType‘ object has no attribute ‘replace](https://blog.csdn.net/weixin_44158997/article/details/129757522)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [BUG笔记【1】:AttributeError: ‘NoneType‘ object has no attribute ‘replace](https://blog.csdn.net/Thomas___/article/details/127809130)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文