title: Scrape data from Apex which created with PL/SQL dynamic content?
body: <p>I have used PL/SQL dynamic content for creating a report. I need to add functionality to scrape (take data) from this HTML. Moreover, I have SQL which returns data.</p>
  
  <p>How can I do this with APEX region PL/SQL dynamic content?</p>
  
  <p>PL/SQL code for creating HTML tags with data:</p>
  
  <pre><code>declare     
    l_sql varchar2(2000) := test.function(92500, 2017, 2, 114); --return which select when we dynamical execute this select it will return data
  
    l_columns varchar2(2000) := test.test_function_dynamic_columns_name(92500, 2017, 2, 114);
    l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
  
    v_tableclob clob := '&lt;table summary="" class="a-IRR-table" id="2212903112260009" role="presentation"&gt;';
    v_rowclob clob;
    v_rowclob_1 clob;
  begin   
    l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(l_columns);
    v_tableclob := v_tableclob||'&lt;tr&gt;'; 
    v_tableclob := v_tableclob ||'&lt;th class="a-IRR-header"&gt;';
    v_tableclob := v_tableclob ||REPLACE(REPLACE(l_columns,'"',' '),':','&lt;/th&gt;&lt;th class="a-IRR-header"&gt;');
    v_tableclob := v_tableclob ||'&lt;/th&gt;&lt;/tr&gt;';
  
    FOR z IN 1..l_vc_arr2.count LOOP
      if l_vc_arr2(z) = '"SUM"' then
         v_rowclob := v_rowclob ||'&lt;td class="summation"&gt;''||t.'||l_vc_arr2(z)||'||''&lt;/td&gt;';
         v_rowclob_1 := v_rowclob_1 || '&lt;td id="total_sum"&gt;&lt;/td&gt;';
      else
         v_rowclob := v_rowclob ||'&lt;td&gt;''||t.'||l_vc_arr2(z)||'||''&lt;/td&gt;';
         v_rowclob_1 := v_rowclob_1 ||  '&lt;td&gt;&lt;/td&gt;';
      end if;
    end loop;
  
    execute immediate 
     ' 
      declare 
      begin 
        htp.p('''||v_tableclob||''');
  
        for t in ('||l_sql||') loop
          htp.p(''&lt;tr&gt;'||v_rowclob||'&lt;/tr&gt;'');
        end loop;
  
        htp.p(''&lt;tr&gt;'');
        htp.p('''|| v_rowclob_1 ||''');
        htp.p(''&lt;/tr&gt;'');
        htp.p(''&lt;/table&gt;'');   
      end;'; 
  
  end; 
  </code></pre>