I want to collect the _response_body of a certain website ( for example https://www.odnzkg.nl/mozard/!suite86.scherm0325?mPag=636 ). Normally the HTTPcaller or HTML tabel in a FeatureReader does the trick. However, by trying this on the url posted above it returns
HTTPCaller(HTTPFactory): HTTP/FTP transfer error: 'Number of redirects hit maximum amount'
HTTPCaller(HTTPFactory): Please ensure that your network connection is properly set up
HTTPCaller(HTTPFactory): No proxy settings have been entered. If you require a proxy to access external URLs, please ensure the appropriate information has been entered
I already tried it at different networks to check if it is a proxy error. When I try to retrieve the HTML code using a PythonCaller it returns the required response_body
import fme
import fmeobjects
import requests as req
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def processFeature(feature):
url = 'https://www.odnzkg.nl/mozard/!suite86.scherm0325?mPag=636'
resp = req.get(url)
print('Response_body: ' + resp.text)
feature.setAttribute("httpBody", resp.text)
pass
Does somebody know the reason that it works via Python? Does it have something to do with the way the url request is formulated?
Thanks in advance,
Bart