|
Mike Ault thanks Michael Cunningham for his help in responding to this question.
Here is a way to do this. This sample assumes the site is NOT https. For that the reader would need to read up on this package in Oracle document B10802-01. It also assumes the machine Oracle is on can make http requests from the Internet.
The anonymous block below looks at the Google site. On that site there is an HTML input item with the name of "q" (where the search text is typed in). The code below checks to see if the item with "name=q" exists on the HTML page. For the reader I would think he/she could do the same, but for a particular item on the page of the 'interactive' page mentioned. If the item does not exist on the page, then the text returned in the request is likely for a static page.
Also note: The http response is returned in a TABLE type. I'm only checking the first array item in the TABLE. If the http response is larger you would need to check more array items.
declare
html_pieces utl_http.html_pieces; -- TABLE type each item is VARCHAR2(2000)
n_length pls_integer;
begin
html_pieces := utl_http.request_pieces( 'http://www.google.com/', 10 );
n_length := instr( html_pieces(1), 'name=q' );
if n_length <> 0 then
dbms_output.put_line( 'Page is not static.' );
else
dbms_output.put_line( 'Page is static.' );
end if;
end;
/
|