Python を使用して IE インスタンスを開き、特定のサイトに移動して、ログイン資格情報を入力しようとしています。私は現在、IEC を機能させようとしていますが、同じことを行う他のオプションも受け入れています。
「ボタン」が認識されていないようで、最後の部分(ログイン)に問題があります。ボタン (role="button") として機能するある種のトリガーのように見えますか? 私はこれにあまり慣れていません:
<a title="Click here to log in." class="focus-parent ajax-request need-focus-pageobject" role="button" href="../MyAccount/MyAccountUserLogin.asp?Referrer=&AjaxRequest=true">
ここに私が試したコードがあります:
import IEC
ie = IEC.IEController()
ie.Navigate('https://efun.toronto.ca/torontofun/Start/Start.asp')
ie.PollWhileBusy()
# code after here does not work properly
ie.Navigate('https://efun.toronto.ca/torontofun/MyAccount/MyAccountUserLogin.asp?Referrer=&AjaxRequest=true')
ie.ClickButton(caption='toolbar-login')
ie.SetInputValue('ClientBarcode', '123')
ie.SetInputValue('AccountPIN', 'XYZ')
ie.ClickButton(name='Enter')
この場合、ログイン メニューを開く方法についてのヒントをいただければ幸いです。