AI智能
改变未来

ValueError: Port could not be cast to integer value as ‘8000app‘

使用pyhton拼接url后解析url时报错:
代码:

parse_result = urllib.parse.urlparse(url)protocol = parse_result.schemeip = parse_result.hostnameport = parse_result.port

报错:

ValueError: Port could not be cast to integer value as \'8000app\'

解决:
端口号后面拼接少/

127.0.0.1:8000/app/index?id=000

这就是不够仔细造成的,这种问题少犯

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » ValueError: Port could not be cast to integer value as ‘8000app‘