i hope me little problem or put me @ least in right direction. i'm looking solution automatically login myself hotspot of german telekom python script.
i think urlib libary want. attempt mechanize failed because page javascript requires. in post submitting form (python) found how solve not getting right values send with.
<div id="hotspotloginbox" class="takt"> <form id="f_login" name="f_login" method="post" action="https://rlp.telekom.de/wlan/rlp.do" enctype="application/x-www-form-urlencoded"> <input name="t" type="hidden" value="fiebx=e;ad;a;c4;"/> <input id="f_login_submit" name="f_login_submit" type="submit" style="display:none" tabindex="999" /> <!--<tm:submit tabindex="999" image="" style="display:none" id="f_login_submit"></tm:submit>--> <script type="text/javascript"> /* <![cdata[ */ if( jquery('#tloginerrmsgbox span.terrmsg').first().children().length != 0 ) { jquery('#tloginerrmsgbox').removeclass('hide'); jquery('.borderbottom').removeclass('borderbottom'); jquery('.fontabs').removeclass('marginbottom'); } /* ]]> */ </script> <div class="tinp withicon "> <label for="username">e-mail adresse oder benutzername</label> <input type="text" maxlength="72" value="" autocapitalize="off" name="username" id="username" tabindex="10" class="large" /> <div title="fallback tooltip (no js)" id="usernametooltipwrapper_dsk" class="tnomob tooltip top-left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="user_tooltip_dsk"> <p><br/><a href="/td/de_de/web/help_and_service/how_it_works.html#a0" target="_blank">telekom festnetz-kunden mit hotspot basic / hotspot flat</a><br/><br/><a href="/td/de_de/web/help_and_service/how_it_works.html#a0" target="_blank">telekom mobilfunk-kunden mit hotspot basic / hot spot flat</a><br/><br/><a href="/td/de_de/web/help_and_service/how_it_works.html#a0" target="_blank">kunden mit hotspot konto / hotspot pass</a><br/><br/></p> <p class="tartsp"> </p> <p class="tartsp"> </p> </div> </div> <div title="fallback tooltip (no js)" id="usernametooltipwrapper_mob" class="tismob tooltip left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="user_tooltip_mob"> <p><br/><a href="/td/de_de/web/help_and_service/how_it_works.html#a0" target="_blank">telekom festnetz-kunden mit hotspot basic / hotspot flat</a><br/><br/><a href="/td/de_de/web/help_and_service/how_it_works.html#a0" target="_blank">telekom mobilfunk-kunden mit hotspot basic / hot spot flat</a><br/><br/><a href="/td/de_de/web/help_and_service/how_it_works.html#a0" target="_blank">kunden mit hotspot konto / hotspot pass</a><br/><br/></p> <p class="tartsp"> </p> <p class="tartsp"> </p> </div> </div> <div class="right"> <a href="/fon_ext/de_de/web/help_and_service/forgot_password.html"> passwort vergessen? </a> </div> </div> <div class="tinp withicon "> <label for="password">passwort</label> <input name="password" id="password" type="password" tabindex="20" autocomplete="off" class="large" title="no description available" /> <div title="fallback tooltip (no js)" id="pwdtooltipwrapper_mob" class="tismob tooltip left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="pwd_tooltip_mob"> <p>bitte beachten sie die groß- und kleinschreibung.</p></div> </div> <div title="fallback tooltip (no js)" id="pwdtooltipwrapper_dsk" class="tnomob tooltip top-left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="pwd_tooltip_dsk"> <p>bitte beachten sie die groß- und kleinschreibung.</p></div> </div> </div> <div class="tclr"></div> <p class="tlogchk"> <input type="hidden" name="hspname" value="fon:de" /><input type="hidden" name="vnpname" value="fon:de" /><input type="hidden" name="wispurl" value="https%3a%2f%2ftelekom.portal.fon.com%2fsrcdta01%2ffon%2f24f50d843397a4de51ed6e3535dae5eb168bd9e1%3fres%3dvnp-login%26nasid%3dd4-21-22-e6-f2-50%26uamip%3d172.17.2.1%26uamport%3d3990%26mac%3d40-a5-ef-94-b8-a8%26challenge%3db66a8c41cc8a8f12e1049126a402ab1a%26hspname%3dfon%253ade%26vnpname%3dfon%253ade%26locationname%3dfon%253ade%26userurl%3dhttp%253a%252f%252f%252f%26stragb%3d1%26locationid%3dfon%253ade%26language%3dde_de%26tab%3d2" /><input type="hidden" name="wispurlhome" value="https%3a%2f%2ftelekom.portal.fon.com%2fsrcdta01%2ffon%2f24f50d843397a4de51ed6e3535dae5eb168bd9e1%3fres%3dnotyet%26nasid%3dd4-21-22-e6-f2-50%26uamip%3d172.17.2.1%26uamport%3d3990%26mac%3d40-a5-ef-94-b8-a8%26challenge%3db66a8c41cc8a8f12e1049126a402ab1a%26userurl%3dhttp%253a%252f%252f%252f%26ip%3d172.17.2.2%26called%3dd4-21-22-e6-f2-50%26sessionid%3d59b2d19100000001%26md%3dee9b6397622814b5aeff8de9b41e94c8%26tab%3d2" /><input type="hidden" name="locationname" value="fon:de" /><input type="hidden" name="locationid" value="fon:de" /><input type="hidden" name="language" value="de_de" /> <input type="hidden" name="realm" id="rrid" value="t-mobile.net" /> <input type="hidden" name="roamrealm" id="rrid" value="t-mobile.net" /><input jsfc="tm:input" type="checkbox" class="tchkb" id="terms_conditions" name="terms_conditions" checked="checked" style="display: none;" /> <input id="terms_conditions" type="checkbox" name="stragb" value="agb" checked="checked" style="display: none;" class="tchkb" /> <input id="payment_advice" type="checkbox" name="strhinweis" value="zahlungsbedingungen" checked="checked" style="display: none;" class="tchkb" /> ich akzeptiere die <a href="/fon_ext/downloads/legal_notice_de,tid=da.pdf" target="_blank">nutzunsbedingungen.</a> </p> <p class="tftn">ich akzeptiere die <a href="/fon_ext/de_de/web/aboutfon/agb_de.html">agb und preise zu hotspot</a></p> <div class="tctr"> <span class="tbutt tbuttm"> <a id="btncheckpriceshock" tabindex="40" href="#" class="tnomob button embossed magenta large center">verbindung herstellen</a> <a tabindex="40" onclick="jquery('#btncheckpriceshock').click()" class="tismob button embossed large magenta center">verbindung herstellen</a> </span> </div> <input jsfc="tm:input" type="checkbox" id="clear_session" name="clear_session" checked="checked" style="display: none;" /> </form> </div> <div id="fonloginbox" class="tnoakt"> <form action="https://telekom.portal.fon.com/srcdta01/fon/24f50d843397a4de51ed6e3535dae5eb168bd9e1?res=login&nasid=d4-21-22-e6-f2-50&uamip=172.17.2.1&uamport=3990&mac=40-a5-ef-94-b8-a8&challenge=b66a8c41cc8a8f12e1049126a402ab1a&userurl=http%3a%2f%2f%2f&tab=2" name="login_fon" id="f_fon_login" method="post"> <input id="f_fon_login_submit" name="f_fon_login_submit" type="submit" style="display:none" tabindex="5" /> <input id="f_fon_login_tab" name="tab" type="hidden" value="2" /> <div id="tloginerrmsgbox" style="display:none;border-top: 1px solid #dcdcdc;"> <p> <span id="fonloginerror" class="terrmsg"> ihre hotspot sitzung wurde beendet und sie wurden erfolgreich abgemeldet.<br /> </span> </p> <div style="top: 82px;" class="tlyrarr"></div> </div> <div class="fon_login_selector"> <select id="fon_selector" class="tk-dropdown tooltip" name="partner"> <option class="fon option" value="">partner wählen</option> <option class="fon option" value="oiwifi">oi</option><option class="fon option" value="belgacom">proximus</option><option class="fon option" value="bt">bt</option><option class="fon option" value="netia">netia</option><option class="fon option" value="softbank">softbank</option><option class="fon option" value="nos">nos</option><option class="fon option" value="fon" selected>fon</option><option class="fon option" value="croatia">hrvatski telekom</option><option class="fon option" value="sfr">sfr</option><option class="fon option" value="ote">cosmote</option><option class="fon option" value="mweb">mweb</option><option class="fon option" value="rtc">telekom romania</option><option class="fon option" value="kpn">kpn</option><option class="fon option" value="telstra">telstra</option><option class="fon option" value="vfes">vodafone españa</option><option class="fon option" value="vfit">vodafone italia</option> </select> </div> <div class="tinp withicon "> <label for="username">e-mail adresse oder benutzername</label> <input id="fon_username" type="text" name="username" value="" tabindex="10" class="large" /> <div title="fallback tooltip (no js)" id="usernametooltipwrapper_dsk" class="tnomob tooltip top-left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="user_tooltip_dsk"> <p>ihr fon benutzername ist die e-mail adresse mit der sie sich bei fon registriert haben.</p></div> </div> <div title="fallback tooltip (no js)" id="usernametooltipwrapper_mob" class="tismob tooltip left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="user_tooltip_mob"> <p>ihr fon benutzername ist die e-mail adresse mit der sie sich bei fon registriert haben.</p></div> </div> </div> <div class="tinp withicon "> <div class="right"> <a style="color:#fab033" href="https://recover-password.fon.com">passwort vergessen?</a> </div> <label for="password">passwort</label> <input id="fon_password" type="password" name="password" value="" tabindex="20" autocomplete="off" class="large" title="no description available" /> <div title="fallback tooltip (no js)" id="pwdtooltipwrapper_mob" class="tismob tooltip left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="pwd_tooltip_mob"> <p>bitte groß- und kleinschreibung beachten.</p></div> </div> <div title="fallback tooltip (no js)" id="pwdtooltipwrapper_dsk" class="tnomob tooltip top-left"> <div class="font-size-default tooltip-icon icon" >i</div> <div class="tooltip-content hide" id="pwd_tooltip_dsk"> <p>bitte groß- und kleinschreibung beachten.</p></div> </div> </div> <input type="hidden" name="hspname" value="fon:de" /><input type="hidden" name="vnpname" value="fon:de" /><input type="hidden" name="wispurl" value="https%3a%2f%2ftelekom.portal.fon.com%2fsrcdta01%2ffon%2f24f50d843397a4de51ed6e3535dae5eb168bd9e1%3fres%3dvnp-login%26nasid%3dd4-21-22-e6-f2-50%26uamip%3d172.17.2.1%26uamport%3d3990%26mac%3d40-a5-ef-94-b8-a8%26challenge%3db66a8c41cc8a8f12e1049126a402ab1a%26hspname%3dfon%253ade%26vnpname%3dfon%253ade%26locationname%3dfon%253ade%26userurl%3dhttp%253a%252f%252f%252f%26stragb%3d1%26locationid%3dfon%253ade%26language%3dde_de%26tab%3d2" /><input type="hidden" name="wispurlhome" value="https%3a%2f%2ftelekom.portal.fon.com%2fsrcdta01%2ffon%2f24f50d843397a4de51ed6e3535dae5eb168bd9e1%3fres%3dnotyet%26nasid%3dd4-21-22-e6-f2-50%26uamip%3d172.17.2.1%26uamport%3d3990%26mac%3d40-a5-ef-94-b8-a8%26challenge%3db66a8c41cc8a8f12e1049126a402ab1a%26userurl%3dhttp%253a%252f%252f%252f%26ip%3d172.17.2.2%26called%3dd4-21-22-e6-f2-50%26sessionid%3d59b2d19100000001%26md%3dee9b6397622814b5aeff8de9b41e94c8%26tab%3d2" /><input type="hidden" name="locationname" value="fon:de" /><input type="hidden" name="locationid" value="fon:de" /><input type="hidden" name="language" value="de_de" /> <div class="fonbutton tctr"> <span class="tbutt tbuttm"> <a tabindex="40" id="fon_submit_button_dsk" onclick="jquery('#f_fon_login').submit();return false;" href="javascript:submit()" class="tnomob button embossed large center">verbindung herstellen</a> <a tabindex="40" id="fon_submit_button" onclick="jquery('#f_fon_login').submit();return false;" href="javascript:submit()" class="tismob button embossed large center">verbindung herstellen</a> </span> </div> <div class="fon_logbox_branding tnomob" > <img src="/shared/static_fon/imgs/desktop_fon_logo_loginbox,tid=da.png" alt="fon" /> </div> <div class="fon_logbox_branding tismob" > <img src="/shared/static_fon/imgs/mob_fon_logo,tid=da.png" alt="fon"/> </div> </form> </div> </div>
could give me hint? thank you.
mechanize doesn't support javascript.
use selenium webdriver.
pip install selenium
Comments
Post a Comment