登录QC库要加载很多插件,我查阅了部分资料,然后自己模仿写了一段,执行过程中却要报错,不知道为什么会报这样的错误,路过的大神们怎么看? 求指教
from win32com.client import Dispatch
qcServer = "https://10.135.55.13/qcbin/start_a.htm"
qcUser = "user"
qcPassword = "123456"
qcDomain = "MBB"
qcProject = "RP_IV"
def get_QCConnection(qcServer,qcUser,qcPassword,qcDomain,qcProject):
QCConnection = Dispatch("TDApiOle80.TDConnection")
QCConnection.InitConnectionEx(qcServer)
QCConnection.Login(qcUser, qcPassword)
QCConnection.Connect(qcDomain, qcProject)
return QCConnection
conn = get_QCConnection(qcServer,qcUser,qcPassword,qcDomain,qcProject)
执行的后出现错误为:
raceback (most recent call last):
File "C:\Users\chenrxia\Desktop\Workspaces\PYTHON\Scripts\test.py", line 83, in <module>
conn = get_QCConnection(qcServer,qcUser,qcPassword,qcDomain,qcProject)
File "C:\Users\chenrxia\Desktop\Workspaces\PYTHON\Scripts\test.py", line 55, in get_QCConnection
QCConnection.Login(qcUser, qcPassword)
File "<COMObject TDApiOle80.TDConnection>", line 3, in Login
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, u'Invalid server response', u'<html><head><title>Apache Tomcat/5.5.9 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /qcbin/start_a.htm/servlet/tdservlet/TDAPI_GeneralWebTreatment</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/qcbin/start_a.htm/servlet/tdservlet/TDAPI_GeneralWebTreatment</u></p><p><b>description</b> <u>The requested resource (/qcbin/start_a.htm/servlet/tdservlet/TDAPI_GeneralWebTreatment) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.9</h3></body></html>', 0, -2147482494), None)
问了一个老外,得到了答案,为什么链接会报错,原因是地址有问题,qcServer="https://10.135.55.13/qcbin/"就没问题了,哈哈
求教,能在64位的win7中使用吗?
回复<aclass='referer'target='_blank'>@蜡笔不小心:试过了,应该要用32位的python和win32com,不能用64位的,最开始直接用64位了,就悲剧了。应该可以把,找pywin32的64位模块安装了版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。