http://m.dianping.com/shop/22242399
I tired the HTTPcaller to download the .css file from DianPing. It returns an error.
http://m.dianping.com/shop/22242399
I tired the HTTPcaller to download the .css file from DianPing. It returns an error.
FME should be able to retrieve any resource that can be accessed via HTTP using the HttpCaller. But without the actual url/uri you use to retrieve the CSS, it's rather impossible to comment further. You may also need to set up some specific header information in HttpCaller, e.g. some login or ticket information. In your case maybe also some transfer-encoding information.
FME should be able to retrieve any resource that can be accessed via HTTP using the HttpCaller. But without the actual url/uri you use to retrieve the CSS, it's rather impossible to comment further. You may also need to set up some specific header information in HttpCaller, e.g. some login or ticket information. In your case maybe also some transfer-encoding information.
This is the url. I tried to set up the header information in httpcaller, but it doesn't work.
Unfortunately the HTTPCaller seems to dislike raw responses without any content-type headers, such as is the case when you try to read the CSS from this server.
However, you can use a small Python script instead:
import fmeobjects
try:
import urllib2 as urlreq # Python 2
except:
import urllib.request as urlreq # Python 3
def raw_get(feature):
req = urlreq.Request("http://s3plus.meituan.net/v1/mss_0a06a471f9514fc79c981b5466f56b91/svgtextcss/dc63fe513c002f0f6dde345e4bbb7bdf.css")
contents = urlreq.urlopen(req).read()
feature.setAttribute('css_contents', contents.decode("utf-8"))
The output feature will have a new attribute css_contents containing the raw text returned by the URL.
Unfortunately the HTTPCaller seems to dislike raw responses without any content-type headers, such as is the case when you try to read the CSS from this server.
However, you can use a small Python script instead:
import fmeobjects
try:
import urllib2 as urlreq # Python 2
except:
import urllib.request as urlreq # Python 3
def raw_get(feature):
req = urlreq.Request("http://s3plus.meituan.net/v1/mss_0a06a471f9514fc79c981b5466f56b91/svgtextcss/dc63fe513c002f0f6dde345e4bbb7bdf.css")
contents = urlreq.urlopen(req).read()
feature.setAttribute('css_contents', contents.decode("utf-8"))
The output feature will have a new attribute css_contents containing the raw text returned by the URL.
Wow! I'll have a try, thanks very much.
Unfortunately the HTTPCaller seems to dislike raw responses without any content-type headers, such as is the case when you try to read the CSS from this server.
However, you can use a small Python script instead:
import fmeobjects
try:
import urllib2 as urlreq # Python 2
except:
import urllib.request as urlreq # Python 3
def raw_get(feature):
req = urlreq.Request("http://s3plus.meituan.net/v1/mss_0a06a471f9514fc79c981b5466f56b91/svgtextcss/dc63fe513c002f0f6dde345e4bbb7bdf.css")
contents = urlreq.urlopen(req).read()
feature.setAttribute('css_contents', contents.decode("utf-8"))
The output feature will have a new attribute css_contents containing the raw text returned by the URL.
Could we call it a bug that FME is not able to accept raw content. I tried different settings like tread as binary, write to file, but FME does not accept.
I think that if I say the data is binary FME must accept my settings.
Could we call it a bug that FME is not able to accept raw content. I tried different settings like tread as binary, write to file, but FME does not accept.
I think that if I say the data is binary FME must accept my settings.
Yes, that would be my opinion as well.