请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

请问老师,这个报错怎么解决?

import re
import ast

import requests

from csdn_spider.Models import *

def get_nodes_json():
    left_menu_text = requests.get("https://bbs.csdn.net/dynamic_js/left_menu.js?csdn").text
    nodes_str_serch = re.search("forumNodes:(.*])",left_menu_text)         
    if nodes_str_serch:
        nodes_str = nodes_str_serch.group(1).replace("null","None") 
        nodes_list = ast.literal_eval(nodes_str) #将nodes_str转换为list
        return nodes_list
    return []
url_list = []
def process_nodes_list(nodes_list):
    #将json的格式提取出url到list
    for item in nodes_list:
        if "url" in item:
            if item["url"]:
                url_list.append(item["url"])
            if "children" in item:
                process_nodes_list(item["children"])

nodes_list =  get_nodes_json()
process_nodes_list(nodes_list)
print(url_list)
#以下是报错信息
Traceback (most recent call last):
  File "E:/python/项目/csdn_spider/spider.py", line 31, in <module>
    nodes_list =  get_nodes_json()
  File "E:/python/项目/csdn_spider/spider.py", line 18, in get_nodes_json
    nodes_list = ast.literal_eval(nodes_str) #将nodes_str转换为list
  File "E:\Python\lib\ast.py", line 46, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "E:\Python\lib\ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 1
    [{"name":"\u79fb\u52a8\u5f00\u53d1","url":"/forums/Mobile","children":[{"name":"iOS","url":"/forums/ios"},{"name":"Android","url":"/forums/Android"},{"name":"Swift","url":"/forums/swift"},{"name":"Windows\u5ba2\u6237\u7aef\u5f00\u53d1","url":"/forums/WindowsMobile"},{"name":"Symbian","url":"/forums/Symbian"},{"name":"BlackBerry","url":"/forums/BlackBerry"},{"name":"Qt","url":"/forums/Qt"},{"name":"\u5fae\u4fe1\u652f\u4ed8","url":"/forums/wechatpay"},{"name":"\u79fb\u52a8\u5e7f\u544a","url":"/forums/MobileAD"},{"name":"\u5fae\u4fe1\u5f00\u53d1","url":"/forums/weixin"},{"name":"\u79fb\u52a8\u5f00\u53d1\u5176\u4ed6\u95ee\u9898","url":"/forums/Mobile_Other"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/MobileNonTechnical"},{"name":"\u8054\u901aWO+\u5f00\u653e\u5e73\u53f0","url":"/forums/chinaunicom"}]},{"name":"\u4e91\u8ba1\u7b97","url":"/forums/CloudComputing","children":[{"name":"PaaS/SaaS","children":[{"name":"Cloud Foundry","url":"/forums/CloudFoundry"},{"name":"GAE","url":"/forums/GAE"}]},{"name":"\u6570\u636e\u4e2d\u5fc3\u8fd0\u7ef4","children":[{"name":"\u670d\u52a1\u5668","url":"/forums/server"},{"name":"\u7f51\u7edc","url":"/forums/network"},{"name":"\u865a\u62df\u5316","url":"/forums/virtual"}]},{"name":"AWS","url":"/forums/AWS"},{"name":"\u534e\u4e3a\u4e91\u8ba1\u7b97","url":"/forums/huaweicloud"},{"name":"\u4e91\u5b89\u5168","url":"/forums/ST_Security"},{"name":"\u5206\u5e03\u5f0f\u8ba1\u7b97/Hadoop","url":"/forums/hadoop"},{"name":"\u4e91\u5b58\u50a8","url":"/forums/CloudStorage"},{"name":"Docker","url":"/forums/docker"},{"name":"Spark","url":"/forums/spark"},{"name":"\u6570\u5b57\u5316\u4f01\u4e1a\u4e91\u5e73\u53f0","url":"/forums/DE"}]},{"name":"\u533a\u5757\u94fe","url":"/forums/ParentBlockchainTechnology","children":[{"name":"\u533a\u5757\u94fe\u6280\u672f","url":"/forums/BlockchainTechnology"},{"name":"\u706b\u661f\u8d22\u7ecf","url":"/forums/huoxing"}]},{"name":"\u4f01\u4e1aIT","url":"/forums/Enterprise","children":[{"name":"\u4e2d\u95f4\u4ef6","children":[{"name":"\u4e2d\u95f4\u4ef6","url":"/forums/Middleware"}]},{"name":"\u4f01\u4e1a\u7ba1\u7406\u8f6f\u4ef6","children":[{"name":"\u6d88\u606f\u534f\u4f5c","url":"/forums/ExchangeServer"},{"name":"SharePoint","url":"/forums/SharePoint"}]},{"name":"Atlassian\u6280\u672f\u8bba\u575b","url":"/forums/atlassian"},{"name":"JetBrains\u6280\u672f\u8bba\u575b","url":"/forums/JetBrains"},{"name":"\u5730\u7406\u4fe1\u606f\u7cfb\u7edf","url":"/forums/GIS"},{"name":"\u4f01\u4e1a\u4fe1\u606f\u5316","url":"/forums/Enterprise_Information"},{"name":"ERP/CRM","url":"/forums/ERP"},{"name":"\u5176\u4ed6","url":"/forums/Enterprise_Other"},{"name":"Xamarin\u6280\u672f","url":"/forums/Xamarin"},{"name":"Enterprise Architect\u6280\u672f\u8bba\u575b","url":"/forums/EA"}]},{"name":"\u804c\u573a\u733f\u533a","url":"/forums/CAREER"},{"name":".NET\u6280\u672f","url":"/forums/DotNET","children":[{"name":"C#","url":"/forums/CSharp"},{"name":"ASP.NET","url":"/forums/ASPDotNET"},{"name":".NET Framework","url":"/forums/DotNETFramework"},{"name":"Web Services","url":"/forums/DotNETWebServices"},{"name":"VB.NET","url":"/forums/VBDotNET"},{"name":"VC.NET","url":"/forums/VCDotNet"},{"name":"\u56fe\u8868\u533a","url":"/forums/DotNETReport"},{"name":".NET\u6280\u672f\u524d\u77bb","url":"/forums/DotNET_NewTech"},{"name":".NET\u5206\u6790\u4e0e\u8bbe\u8ba1","url":"/forums/DotNETAnalysisAndDesign"},{"name":"\u7ec4\u4ef6/\u63a7\u4ef6\u5f00\u53d1","url":"/forums/DotNET_Controls"},{"name":"LINQ","url":"/forums/LINQ"},{"name":"\u5176\u4ed6","url":"/forums/DotNET_Other"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/DotNETNonTechnical"}]},{"name":"Java \u6280\u672f","url":"/forums/Java","children":[{"name":"Java SE","url":"/forums/J2SE"},{"name":"J2ME","url":"/forums/J2ME"},{"name":"Java Web \u5f00\u53d1","url":"/forums/Java_WebDevelop"},{"name":"Java EE","url":"/forums/J2EE"},{"name":"Eclipse","url":"/forums/Eclipse"},{"name":"Java\u5176\u4ed6\u76f8\u5173","url":"/forums/JavaOther"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/JavaNonTechnical"}]},{"name":"Web \u5f00\u53d1","url":"/forums/WebDevelop","children":[{"name":"ASP","url":"/forums/ASP"},{"name":"JSP","url":"/forums/Java_WebDevelop"},{"name":"PHP","url":"/forums/PHP","children":[{"name":"\u5f00\u6e90\u8d44\u6e90","url":"/forums/PHPOpenSource"},{"name":"\u57fa\u7840\u7f16\u7a0b","url":"/forums/PHPBase"},{"name":"Framework","url":"/forums/PHPFramework"}]},{"name":"JavaScript","url":"/forums/JavaScript"},{"name":"Ajax \u6280\u672f","url":"/forums/Ajax"},{"name":"VBScript","url":"/forums/vbScript"},{"name":"CGI","url":"/forums/CGI"},{"name":"XML/XSL","url":"/forums/XMLSOAP"},{"name":"IIS","url":"/forums/IIS"},{"name":"Apache","url":"/forums/Apache"},{"name":"HTML(CSS)","url":"/forums/HTMLCSS"},{"name":"ColdFusion","url":"/forums/ColdFusion"},{"name":"Ruby/Rails","url":"/forums/ROR"},{"name":"\u8de8\u6d4f\u89c8\u5668\u5f00\u53d1","url":"/forums/CrossBrowser"},{"name":"\u5176\u4ed6","url":"/forums/WebDevelop_Other"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/WebNonTechnical"},{"name":"HTML5","url":"/forums/HTML5"}]},{"name":"\u5f00\u53d1\u8bed\u8a00/\u6846\u67b6","children":[{"name":"VC/MFC","url":"/forums/VC","children":[{"name":"\u57fa\u7840\u7c7b","url":"/forums/VC_Basic"},{"name":"\u754c\u9762","url":"/forums/VC_UI"},{"name":"\u7f51\u7edc\u7f16\u7a0b","url":"/forums/VC_Network"},{"name":"\u8fdb\u7a0b/\u7ebf\u7a0b/DLL","url":"/forums/VC_Process"},{"name":"ATL/ActiveX/COM","url":"/forums/VC_ActiveX"},{"name":"\u6570\u636e\u5e93","url":"/forums/VC_Database"},{"name":"\u786c\u4ef6/\u7cfb\u7edf","url":"/forums/VC_Hardware"},{"name":"HTML/XML","url":"/forums/VC_HTML"},{"name":"\u56fe\u5f62\u5904\u7406/\u7b97\u6cd5","url":"/forums/VC_ImageProcessing"},{"name":"\u8d44\u6e90","url":"/forums/VCResources"},{"name":"\u975e\u6280\u672f\u7c7b","url":"/forums/VC_NonTechnical"}]},{"name":"VB","url":"/forums/VB","children":[{"name":"\u57fa\u7840\u7c7b","url":"/forums/VB_Basic"},{"name":"\u975e\u6280\u672f\u7c7b","url":"/forums/VB_NonTechnical"},{"name":"\u63a7\u4ef6","url":"/forums/VB_Controls"},{"name":"API","url":"/forums/VB_API"},{"name":"\u6570\u636e\u5e93(\u5305\u542b\u6253\u5370\uff0c\u5b89\u88c5\uff0c\u62a5\u8868)","url":"/forums/VB_Database"},{"name":"\u591a\u5a92\u4f53","url":"/forums/VB_Multimedia"},{"name":"\u7f51\u7edc\u7f16\u7a0b","url":"/forums/VB_Network"},{"name":"VBA","url":"/forums/VBA"},{"name":"COM/DCOM/COM+","url":"/forums/VB_COM"},{"name":"\u8d44\u6e90","url":"/forums/VBResources"}]},{"name":"Delphi","url":"/forums/Delphi","children":[{"name":"VCL\u7ec4\u4ef6\u5f00\u53d1\u53ca\u5e94\u7528","url":"/forums/DelphiVCL"},{"name":"\u6570\u636e\u5e93\u76f8\u5173","url":"/forums/DelphiDB"},{"name":"Windows SDK/API","url":"/forums/DelphiAPI"},{"name":"\u7f51\u7edc\u901a\u4fe1/\u5206\u5e03\u5f0f\u5f00\u53d1","url":"/forums/DelphiNetwork"},{"name":"\u8bed\u8a00\u57fa\u7840/\u7b97\u6cd5/\u7cfb\u7edf\u8bbe\u8ba1","url":"/forums/DelphiBase"},{"name":"GAME\uff0c\u56fe\u5f62\u5904\u7406/\u591a\u5a92\u4f53","url":"/forums/DelphiMultimedia"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/DelphiNonTechnical"}]},{"name":"C++ Builder","url":"/forums/BCB","children":[{"name":"\u57fa\u7840\u7c7b","url":"/forums/BCBBase"},{"name":"\u6570\u636e\u5e93\u53ca\u76f8\u5173\u6280\u672f","url":"/forums/BCBDB"},{"name":"VCL\u7ec4\u4ef6\u4f7f\u7528\u548c\u5f00\u53d1","url":"/forums/BCBVCL"},{"name":"Windows SDK/API","url":"/forums/BCBAPI"},{"name":"\u7f51\u7edc\u53ca\u901a\u8baf\u5f00\u53d1","url":"/forums/BCBNetwork"},{"name":"ActiveX/COM/DCOM","url":"/forums/BCBCOM"},{"name":"\u8336\u9986","url":"/forums/BCBTeaHouses"}]},{"name":"C/C++","url":"/forums/Cpp","children":[{"name":"\u65b0\u624b\u4e50\u56ed","url":"/forums/Cpp_Freshman"},{"name":"C\u8bed\u8a00","url":"/forums/C"},{"name":"C++ \u8bed\u8a00","url":"/forums/CPPLanguage"},{"name":"\u5de5\u5177\u5e73\u53f0\u548c\u7a0b\u5e8f\u5e93","url":"/forums/Cpp_ToolsPlatform"},{"name":"\u6a21\u5f0f\u53ca\u5b9e\u73b0","url":"/forums/Cpp_Model"},{"name":"\u5176\u4ed6\u6280\u672f\u95ee\u9898","url":"/forums/Cpp_Other"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/Cpp_NonTechnical"}]},{"name":"\u5176\u4ed6\u5f00\u53d1\u8bed\u8a00","url":"/forums/OtherLanguage","children":[{"name":"OpenCL\u548c\u5f02\u6784\u7f16\u7a0b","url":"/forums/Heterogeneous"},{"name":"Go\u8bed\u8a00","url":"/forums/golang"},{"name":"\u6c47\u7f16\u8bed\u8a00","url":"/forums/ASM"},{"name":"\u811a\u672c\u8bed\u8a00\uff08Perl/Python\uff09","url":"/forums/OL_Script"},{"name":"\u5176\u4ed6\u5f00\u53d1\u8bed\u8a00","url":"/forums/OtherLanguage_Other"}]}]},{"name":"\u6570\u636e\u5e93\u5f00\u53d1","url":None,"children":[{"name":"\u5927\u6570\u636e","children":[{"name":"Hadoop","url":"/forums/hadoop"}]},{"name":"MS-SQL Server","url":"/forums/MSSQL","children":[{"name":"\u57fa\u7840\u7c7b","url":"/forums/MSSQL_Basic"},{"name":"\u5e94\u7528\u5b9e\u4f8b","url":"/forums/MSSQL_Cases"},{"name":"\u7591\u96be\u95ee\u9898","url":"/forums/MSSQL_DifficultProblems"},{"name":"\u65b0\u6280\u672f\u524d\u6cbf","url":"/forums/MSSQL_NewTech"},{"name":"\u975e\u6280\u672f\u7248","url":"/forums/MSSQL_NonTechnical"}]},{"name":"PowerBuilder","url":"/forums/PowerBuilder","children":[{"name":"\u57fa\u7840\u7c7b","url":"/forums/PB_Basic"},{"name":"Pb\u811a\u672c\u8bed\u8a00","url":"/forums/PBScript"},{"name":"DataWindow","url":"/forums/PB_DataWindow"},{"name":"API \u8c03\u7528","url":"/forums/PB_API"},{"name":"\u63a7\u4ef6\u4e0e\u754c\u9762","url":"/forums/PB_Controls"},{"name":"Pb Web \u5e94\u7528","url":"/forums/PB_WEB"},{"name":"\u6570\u636e\u5e93\u76f8\u5173","url":"/forums/PB_Database"},{"name":"\u9879\u76ee\u7ba1\u7406","url":"/forums/PB_ProjectManagement"},{"name":"\u975e\u6280\u672f\u7248","url":"/forums/PB_NonTechnical"}]},{"name":"Oracle","url":"/forums/Oracle","children":[{"name":"\u57fa\u7840\u548c\u7ba1\u7406","url":"/forums/Oracle_Management"},{"name":"\u5f00\u53d1","url":"/forums/Oracle_Develop"},{"name":"\u9ad8\u7ea7\u6280\u672f","url":"/forums/Oracle_Technology"},{"name":"\u8ba4\u8bc1\u4e0e\u8003\u8bd5","url":"/forums/Oracle_Certificate"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/Oracle_NonTechnical"}]},{"name":"Informatica","url":"/forums/Informatica"},{"name":"\u5176\u4ed6\u6570\u636e\u5e93\u5f00\u53d1","url":"/forums/OtherDatabase","children":[{"name":"MongoDB","url":"/forums/MongoDB"},{"name":"\u6570\u636e\u4ed3\u5e93","url":"/forums/DataWarehouse"},{"name":"VFP","url":"/forums/VFP"},{"name":"Access","url":"/forums/Access"},{"name":"Sybase","url":"/forums/Sybase"},{"name":"Informix","url":"/forums/Informix"},{"name":"MySQL","url":"/forums/MySQL"},{"name":"PostgreSQL","url":"/forums/PostgreSQL"},{"name":"Greenplum","url":"/forums/Greenplum"},{"name":"\u6570\u636e\u5e93\u62a5\u8868","url":"/forums/DatabaseReport"},{"name":"\u5176\u4ed6\u6570\u636e\u5e93","url":"/forums/OtherDatabase_Other"},{"name":"\u9ad8\u6027\u80fd\u6570\u636e\u5e93\u5f00\u53d1","url":"/forums/HPDatabase"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/DatabaseNonTechnical"}]}]},{"name":"Linux/Unix\u793e\u533a","url":"/forums/Linux","children":[{"name":"\u7cfb\u7edf\u7ef4\u62a4\u4e0e\u4f7f\u7528\u533a","url":"/forums/Linux_System"},{"name":"\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u533a","url":"/forums/Linux_Development"},{"name":"\u5185\u6838\u6e90\u4ee3\u7801\u7814\u7a76\u533a","url":"/forums/Linux_Kernel"},{"name":"\u9a71\u52a8\u7a0b\u5e8f\u5f00\u53d1\u533a","url":"/forums/Linux_Driver"},{"name":"CPU\u548c\u786c\u4ef6\u533a","url":"/forums/Linux_Hardware"},{"name":"\u4e13\u9898\u6280\u672f\u8ba8\u8bba\u533a","url":"/forums/Linux_SpecialTopic"},{"name":"\u5b9e\u7528\u8d44\u6599\u53d1\u5e03\u533a","url":"/forums/Linux_Information"},{"name":"UNIX\u6587\u5316","url":"/forums/Unix_Culture"},{"name":"Solaris","url":"/forums/Solaris"},{"name":"IBM AIX","url":"/forums/AIX"},{"name":"Power Linux","url":"/forums/PowerLinux"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/LinuxNonTechnical"}]},{"name":"Windows\u4e13\u533a","url":"/forums/Windows","children":[{"name":"Windows\u5ba2\u6237\u7aef\u4f7f\u7528","url":"/forums/Windows7"},{"name":"Windows Server","url":"/forums/WinNT2000XP2003"},{"name":"\u7f51\u7edc\u7ba1\u7406\u4e0e\u914d\u7f6e","url":"/forums/NetworkConfiguration"},{"name":"\u5b89\u5168\u6280\u672f/\u75c5\u6bd2","url":"/forums/WindowsSecurity"},{"name":"\u4e00\u822c\u8f6f\u4ef6\u4f7f\u7528","url":"/forums/WindowsBase"},{"name":"Microsoft Office\u5e94\u7528","url":"/forums/OfficeBase"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/WindowsNonTechnical"}]},{"name":"\u786c\u4ef6/\u5d4c\u5165\u5f00\u53d1","url":"/forums/Embedded","children":[{"name":"\u786c\u4ef6\u4f7f\u7528","url":"/forums/HardwareUse"},{"name":"\u5d4c\u5165\u5f00\u53d1(WinCE)","url":"/forums/WinCE"},{"name":"\u786c\u4ef6\u8bbe\u8ba1","url":"/forums/Embedded_hardware"},{"name":"\u9a71\u52a8\u5f00\u53d1/\u6838\u5fc3\u5f00\u53d1","url":"/forums/Embedded_driver"},{"name":"\u5355\u7247\u673a/\u5de5\u63a7","url":"/forums/Embedded_SCM"},{"name":"\u65e0\u7ebf","url":"/forums/Embedded_wireless"},{"name":"\u5176\u4ed6\u786c\u4ef6\u5f00\u53d1","url":"/forums/Embedded_Other"},{"name":"VxWorks\u5f00\u53d1","url":"/forums/VxWorks"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/EmbeddedNonTechnical"},{"name":"\u667a\u80fd\u786c\u4ef6","url":"/forums/SmartHardware"}]},{"name":"\u6e38\u620f\u5f00\u53d1","url":"/forums/GameDevelop","children":[{"name":"Cocos2d-x","url":"/forums/GD_Cocos2d-x"},{"name":"Unity3D","url":"/forums/GD_Unity3D"},{"name":"\u5176\u4ed6\u6e38\u620f\u5f15\u64ce","url":"/forums/Othergameengines"},{"name":"\u6e38\u620f\u7b56\u5212\u4e0e\u8fd0\u8425","url":"/forums/Gdesignoperation"}]},{"name":"\u7f51\u7edc\u4e0e\u901a\u4fe1","url":"/forums/Network_communication","children":[{"name":"\u7f51\u7edc\u534f\u8bae\u4e0e\u914d\u7f6e","url":"/forums/IP_Protocolconfiguration"},{"name":"\u7f51\u7edc\u7ef4\u62a4\u4e0e\u7ba1\u7406","url":"/forums/maintainmanage"},{"name":"\u4ea4\u6362\u53ca\u8def\u7531\u6280\u672f","url":"/forums/Hardware_SwitchRouter"},{"name":"CDN","url":"/forums/NetworkC_CDN"},{"name":"\u901a\u4fe1\u6280\u672f","url":"/forums/ST_Network"},{"name":"VOIP\u6280\u672f\u63a2\u8ba8","url":"/forums/voip"},{"name":"\u667a\u80fd\u8def\u7531\u5668","url":"/forums/IR"}]},{"name":"\u6269\u5145\u8bdd\u9898","url":"/forums/Other","children":[{"name":"\u6d3b\u52a8\u798f\u5229\u4e13\u533a","url":"/forums/Activity"},{"name":"P2P\u7406\u8d22","url":"/forums/p2p"},{"name":"\u56fe\u4e66\u6c47\u603b","url":"/forums/Book"},{"name":"\u7a0b\u5e8f\u4eba\u751f","url":"/forums/ProgrammerStory"},{"name":"IT\u7f18\u5206","url":"/forums/ITFate"},{"name":"\u704c\u6c34\u4e50\u56ed","url":"/forums/FreeZone"},{"name":"\u5927\u5b66\u65f6\u4ee3","url":"/forums/CollegeTime"},{"name":"\u8d70\uff0c\u6253\u602a\u53bb","url":"/forums/Game"},{"name":"\u9996\u90fd\u7f51\u8b66","url":"/forums/sdwj"}]},{"name":"Qualcomm\u5f00\u53d1\u8bba\u575b","children":[{"name":"Qualcomm\u5f00\u53d1","url":"/forums/qualcomm"}]},{"name":"\u4f01\u4e1a\u6280\u672f","children":[{"name":"IBM \u6280\u672f\u793e\u533a","children":[{"name":"WebSphere","url":"/forums/WebSphere"},{"name":"DB2","url":"/forums/DB2"},{"name":"IBM\u4e91\u8ba1\u7b97","url":"/forums/ibmcloud"},{"name":"IBM\u5f00\u53d1\u8005","url":"/forums/IBMDeveloper"},{"name":"IBM AIX","url":"/forums/AIX"},{"name":"Power Linux","url":"/forums/PowerLinux"}]},{"name":"\u82f1\u7279\u5c14\u8f6f\u4ef6\u5f00\u53d1\u793e\u533a","children":[{"name":"\u82f1\u7279\u5c14\u6280\u672f","url":"/forums/intel"}]},{"name":"Paypal\u5f00\u53d1\u8005\u793e\u533a","url":"/forums/PaypalCommunity"},{"name":"Google\u6280\u672f\u793e\u533a","children":[{"name":"Android","url":"/forums/Android"},{"name":"GDG","url":"/forums/GDG"}]},{"name":"Microsoft Office \u5e94\u7528\u4e8e\u5f00\u53d1","children":[{"name":"Office\u5f00\u53d1","url":"/forums/OfficeDevelopment"},{"name":"Office\u4f7f\u7528","url":"/forums/OfficeBase"}]}]},{"name":"\u5176\u4ed6\u6280\u672f\u8bba\u575b","url":"/forums/OtherTechnicalForum","children":[{"name":"Qualcomm\u5f00\u53d1","url":"/forums/qualcomm"},{"name":"VR/AR","url":"/forums/vrar"},{"name":"\u8f6f\u4ef6\u6d4b\u8bd5","url":"/forums/SE_Quality"},{"name":"\u7814\u53d1\u7ba1\u7406","url":"/forums/SE_Management"},{"name":"\u654f\u6377\u5f00\u53d1","url":"/forums/Agile"},{"name":"\u7248\u672c\u63a7\u5236","url":"/forums/CVS_SVN"},{"name":"\u8bbe\u8ba1\u6a21\u5f0f","url":"/forums/DesignPatterns"},{"name":"\u9ad8\u6027\u80fd\u8ba1\u7b97","url":"/forums/HPC"},{"name":"\u9ad8\u6027\u80fdWEB\u5f00\u53d1","url":"/forums/HPWebDevelop"},{"name":"\u9ad8\u6027\u80fd\u6570\u636e\u5e93\u5f00\u53d1","url":"/forums/HPDatabase"},{"name":"\u6d77\u91cf\u6570\u636e\u5904\u7406/\u641c\u7d22\u6280\u672f","url":"/forums/SearchEngine"},{"name":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5","url":"/forums/ST_Arithmetic"},{"name":"OpenAPI","url":"/forums/OpenAPI"},{"name":"OpenStack","url":"/forums/OpenStack"},{"name":"\u673a\u5668\u89c6\u89c9","url":"/forums/ST_Image"},{"name":"OpenCV","url":"/forums/OpenCV"},{"name":"\u4fe1\u606f/\u7f51\u7edc\u5b89\u5168","url":"/forums/ST_Security"},{"name":"\u4eba\u5de5\u667a\u80fd\u6280\u672f","url":"/forums/AI"},{"name":"\u8d28\u91cf\u7ba1\u7406/\u8f6f\u4ef6\u6d4b\u8bd5","url":"/forums/SE_Quality"},{"name":"\u591a\u5a92\u4f53/\u6d41\u5a92\u4f53\u5f00\u53d1","url":"/forums/Multimedia"},{"name":"\u56fe\u8c61\u5de5\u5177\u4f7f\u7528","url":"/forums/ImageTools"},{"name":"Flash\u6d41\u5a92\u4f53\u5f00\u53d1","url":"/forums/FlashDevelop"},{"name":"\u4ea4\u4e92\u5f0f\u8bbe\u8ba1","url":"/forums/InteractiveDesign"},{"name":"WPF/Silverlight","url":"/forums/Silverlight"},{"name":"Flex","url":"/forums/Flex"},{"name":"\u6570\u7801\u8bbe\u5907","url":"/forums/Hardware_Digital"},{"name":"\u7535\u8111\u6574\u673a\u53ca\u914d\u4ef6","url":"/forums/Hardware_Computer"},{"name":"\u5916\u8bbe\u53ca\u529e\u516c\u8bbe\u5907","url":"/forums/Hardware_Peripheral"},{"name":"\u88c5\u673a\u4e0e\u5347\u7ea7\u53ca\u5176\u4ed6","url":"/forums/Hardware_DIY"},{"name":"\u975e\u6280\u672f\u533a","url":"/forums/Hardware_NonTechnical"},{"name":"IBM \u5f00\u53d1\u8005","url":"/forums/IBMDeveloper"},{"name":"\u5176\u4ed6","url":"/forums/ADSOther"}]},{"name":"\u7ad9\u52a1\u4e13\u533a","url":"/forums/Support","children":[{"name":"\u793e\u533a\u516c\u544a","url":"/forums/placard"},{"name":"\u4e0b\u8f7d\u95ee\u9898\u53cd\u9988\u4e13\u533a","url":"/forums/DownloadQuestion"},{"name":"\u535a\u5ba2\u95ee\u9898\u53cd\u9988\u4e13\u533a","url":"/forums/BlogQuestion"},{"name":"\u5ba2\u670d\u4e13\u533a","url":"/forums/Service"},{"name":"\u7248\u4e3b\u4e13\u533a","url":"/forums/Moderator"}]},{"name":"GE Predix\u8bba\u575b","url":"/forums/GEPredixDev"}]
    ^
IndentationError: unexpected indent

正在回答 回答被采纳积分+3

1回答

bobby 2019-07-13 13:47:53

可以把ast.literal_eval(nodes_str)这行替换为eval(nodes_str)

0 回复 有任何疑惑可以回复我~
  • 谢谢老师,解决了
    回复 有任何疑惑可以回复我~ 2019-07-25 16:20:59
  • bobby 回复 芥子啊 #2
    好的,
    回复 有任何疑惑可以回复我~ 2019-07-27 17:25:48
  • 慕容8486466 回复 bobby #3
    老师,我也遇到这个问题了,想问一下老师为什么会报错呀?这么修改的原因是?
    回复 有任何疑惑可以回复我~ 2020-05-14 22:03:33
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信