[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: trying to grab a web page and write to IFS on iseries



Please work through the EXAMPLE programs. That is the "tutorial" and will show several techniques for viewing the files, downloading, parsing, etc.

The debug file is very important to understand. Look in the EXAMPLE programs for information. Setup up some kind of shortcut to view the file created such as a PDM option or macro key: DSPF '/tmp/httpapi_debug.txt'

>Any way to have the HTTPAPI append the DOWNLOAD file instead of replacing it?

Not directly in the current form but it is open source and you could adjust the open API in the procedure you are using or write a new procedure changing the flags on the open or add a parameter to the existing code. Look in http_url_get procedure in HTTPAPIR4 to see how it happens now.
 
> Can you suggest a way to tell if the web page is empty?

I am not sure but I don't think a totally empty web page is allowed by the protocol. I think you'd receive an error instead. If you mean the web page has no useful information...that is left up to you to parse. It would actually be relatively trivial to parse a web page for specific content. If you mean general content, that increases the difficulty of knowing what is good versus bad data. Since this is pretty application specific, an example web page you are trying to download would be helpful. The examples in 1.24 only include parsing web service (XML) style documents. But, if it isn't too much work, we could help you fill out the EXAMPLE22 program to show how to scrape a HTML document.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------