我正在尝试使用Sovren Resume Parser API,我对API很新。我的应用程序是在Django-Python中,因此,我想使用Python脚本实现调用并接收此API。
文档 - http://resumeparsing.com/
我需要概述如何解决这个问题。
答案 0 :(得分:1)
from zeep import Client
client = Client('http://services.resumeparsing.com/ResumeService.asmx?wsdl')
response = client.service.GetAccountInfo(request={'AccountId': 'AccountId','ServiceKey':'ServiceKey'})
print(response)
使用Zeep模块就可以了!这也适用于Python3!
答案 1 :(得分:0)
我在Python中使用以下代码来解析作业顺序和恢复。
我无法弄清楚的一件事是压缩/压缩请求数据。 zlib.compress()或gzip.compress()的输出不起作用。 Web服务抱怨数据转换失败。
from zeep import Client
import os
#If required, set proxy.
#os.environ["http_proxy"] = 'http://user:password@host:port'
#os.environ["https_proxy"] = 'https://user:password@host:port'
account_id = 'account_id'
service_key = 'service_key'
client = Client('http://services.resumeparsing.com/ParsingService.asmx?wsdl')
with open('C:/temp/jd.docx', 'rb') as in_file:
file_bytes = in_file.read()
request = {'AccountId':account_id, 'ServiceKey':service_key, 'FileBytes':file_bytes}
response = client.service.ParseJobOrder(request)
# Similarlly ParseResume() for parsing resume.
print('response.Code = ', response.Code)
print('response.SubCode = ', response.SubCode)
print('response.Message = ', response.Message)
print('response.Xml = ', response.Xml)