Accessing PDF data with xpath

Hi. I was wondering if there is a way to access the pdf base64 data returned from the get_report command using xpath. There is no tag for the data itself.


typ<get_reports_response status="200" status_text="OK">
	<report id="a2ea755c-f41a-4ba8-8d72-2423ae6acc45" format_id="c402cc3e-b531-11e1-9163-406186ea4fc5" extension="pdf" content_type="application/pdf">
		<task id="de984b9c-6429-4906-bbcb-58d6bf06dce0">
		<report_format id="c402cc3e-b531
		</report_format>JVBERi0xLjUKJdDUxdgKNjUgMCBvYmoKPDwKL0xlbmd0aCAxMDYxICAgICAgCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+e....pdf base 64 data

I am not sure if there is an XPath query for that. We are using the Python ETree API. See

1 Like

Thank you for the link.

I have an issue running the code though.

I’m relatively new to python so I might be missing something.

there is a section in the code:

 report_element = response.find("report")
    print('rep element')
    #get the full content of the report element
    content = report_element.find("report_format").tail

report_element is an integer for the character pos. of ‘report’. It’s returning an error trying to run ‘find’ on an integer.