I Use Apache HttpClient to Access a webpage . i want to click on a link but the link is javaScript , how can i process click on a javascript link and follow url redirection ?
sample javascript and html code :
<a href="javascript:send(32023, 'YGHN_JKM', '8LMK');"> link</a>
function send(content_id, fic, cgRate) {
var params = new Hash();
params.set('content_id', content_id);
params.set('tool', fic);
params.set('cgRate', cgRate);
new Ajax.Updater('return', '/mypkg/tools', {
method: 'post',
parameters: params,
evalScripts: true,
onInitialize: new Effect.Appear('loader', {duration: 0.0}),
onComplete: new Effect.Fade('loader', {duration: 1.2})
});
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…