Log In on web page for downloading file

Five Stars

Log In on web page for downloading file

Hi everyone,

 

I'm a beginner in Talend DI.

 

I have to download a csv file since a HTML link on an intranet site, but this need authentification before to download file.

 

So I try to use a TFileFetch with some parameters to try to log in, but I can't. In all case I've the html source code of the page and not the csv file I need.

 

So we need to authentificate but I don't know how with talend component.

 

To detail my process here the job I use :

2018-06-14_10h24_50.pngJibs

 

Here the parameters I use to try to download the page

 

2018-06-14_10h22_44.pngParameters

Some parameters I've tried but nothing change :df
2018-06-14_10h22_52.pngParameters2

A part of the source code I've in output, maybe this can help (the authentification part) :

 

<form action="" name="formconnexion" method="post" onSubmit="connexion();return false;"><input type="hidden" name="P" value="C_AJAX"><input type="hidden" name="action" value="connexionldap">
<table>
    <tr>
        <td valign="top" align="left">
        <img src="../img/design/connexion/img_connexion7.gif">        </td>
        <td valign="top" align="left">
            <fieldset class="adminform"><legend>            <strong>A</strong>uthentification requise afin d'accéder à ce projet
            </legend>            <table>
                <tr>
                    <td valign="middle" align=center>
                    <img src="../img/design/noir-bleu/3.0/images/j_arrow.png"/>                    </td>
                    <td>Nom d'utilisateur:</td><td><input onFocus="setInfo('<img align=absbottom src=../img/design/connexion/about.gif>&nbsp;Tapez dans ce champs <strong>votre nom d\'utilisateur</strong> que<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vous avez au <strong>démarrage</strong> de votre <strong>ordinateur</strong>.');" onBlur="cacheInfo();" type="text" size="30" id="agent_login" name="agent_login" value="LoginExample"></td>                </tr>
                <tr>
                    <td colspan="3" align="center"></td>
                </tr>
                <tr>
                    <td valign="middle">
                    <img src="../img/design/noir-bleu/3.0/images/j_arrow.png"/>                    </td>
                    <td valign="middle">
                    Mot de passe:                    </td>
                    <td>
                    <input onFocus="setInfo('<img align=absbottom src=../img/design/connexion/about.gif>&nbsp;Tapez dans ce champs <strong>votre mot de passe</strong> que<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vous tapez au <strong>démarrage de l\'ordinateur</strong>.');" onBlur="cacheInfo();" type="password" size="30" id="agent_password" name="agent_password">                    </td>
                </tr>
                <tr>
                    <td height="10"></td>
                </tr>
                                <tr>
                    <td></td>
                    <td></td>
                    <td align="right"><input name="boutton" class="soumettre" type="submit" value="Se connecter"></td>
                </tr>
                <tr>
                    <td colspan="3">
                        
                        <div id="progressbar"></div>
                        <span class="status" id="p3text"></span>
                        <div class="infobulle" style="visibility:hidden" id="info"></div>
                    </td>
                </tr>
            </table>
            <br><br><br>
            </fieldset>        </td>
    </tr>
</table>
</form>

 

Thanks if you can help me.

 

Cordially.


Accepted Solutions
Ten Stars

Re: Log In on web page for downloading file

Did you set your headers correctly?
Suggest using fiddler and check what happens if you do it manually through a website.
Copy these headers and set them in your component.

Although I really really suggest using cURL, I tried it with components too, didnt work.
Easy to set cookies... very usefull. Supported on windows and unix/linux. Your jobs wil work on both os (if cUrl installed).

All Replies
Ten Stars

Re: Log In on web page for downloading file

Did you set your headers correctly?
Suggest using fiddler and check what happens if you do it manually through a website.
Copy these headers and set them in your component.

Although I really really suggest using cURL, I tried it with components too, didnt work.
Easy to set cookies... very usefull. Supported on windows and unix/linux. Your jobs wil work on both os (if cUrl installed).
Five Stars

Re: Log In on web page for downloading file

thanks that resolve my problem.