[Resolvido] Como e salvo uma página via cURL
Simplesmente não consigo fazer o cURL funcionar, ou pelo menos não como deveria.
A página carrega e mostra um gif, tipo loading, enquanto um ajax roda no background montando a página. A operação leva uns bons 20 a 30 segundos até que o conteúdo da página apareça, e esse parece ser o problema, o cURL já me retorna direto a página com a animação de loading rodando, ele pega a página antes do loading final.
Como eu resolvo isso?
Código do html, onde deveria ter o conteúdo:
<div class="window">
<div id='loader' style='height: 700px; text-align: center;'>
<img src='http://media.xfire.com/v4/webskins-new/default/images/progress_v2.gif' style='margin-top: 25%;' alt='' />
</div>
<div id="ajax_module_wrapper_game_overview2_385581174" style="display: none;" class="ajax_module_wrapper" ></div>
</div>
Existe um ajax_module_wrapper.js, ao salvar a página:
g_AjaxModuleWrappers = new Array();
g_AMW_argSets = new Array();
// find the wrapper ID instance that owns this child
function AjaxModuleWrapper_GetID( childID ) {
el = $( childID );
do {
el = el.parentNode;
} while( el && el.className != "ajax_module_wrapper" );
if( !el )
return null;
id = el.id;
return id;
}
// store a refresh method for a given instance, in case we need to update that div later (timed refresh, or button/form-based refresh)
function AjaxModuleWrapper_Register( divID, updaterFunc ) {
g_AjaxModuleWrappers[ divID ] = updaterFunc;
}
// store a key/value pair for a given instance
function AjaxModuleWrapper_SetArg( divID, argName, argValue ) {
//alert( "AMW_SetArg( '" + argName + "', '" + argValue + "' )" );
// initialize this arg set if first arg in it
if( !g_AMW_argSets[ divID ] )
g_AMW_argSets[ divID ] = new Object();
// if we're deleting an arg
if( argValue == null )
delete g_AMW_argSets[ divID ][ argName ];
// else store the new value
else g_AMW_argSets[ divID ][ argName ] = argValue;
}
// retrieve an arg from the arg set for a given instance
function AjaxModuleWrapper_GetArg( divID, argName ) {
if( g_AMW_argSets[ divID ][ argName ] )
return g_AMW_argSets[ divID ][ argName ];
else return null;
}
// get the entire arg set for a given instance
function AjaxModuleWrapper_GetArgs( divID ) {
return g_AMW_argSets[ divID ];
}
// refresh an instance
function AjaxModuleWrapper_Refresh( divID, form, button ) {
g_AjaxModuleWrappers[ divID ]( form, button );
}Discussão (2)
Carregando comentários...