Webサイトの特定のボタンをクリックしようとしています。これがコードです。
<div id="ff_submit_button">
<input type="image" onclick="javascript:return preFareFinderSubmitActions('The following information is needed to process your request:', 'Problem Pricing the Itinerary: Atlantic City Express Service offers adult fares only for all passengers. Please modify your selection to continue. \n[Error ID: 1121S]')" src="/images/en/btn_ff_go.gif" alt="Click to Find Tickets" border="0" name="_handler=url.presentation.handler.request.rail.urlRailSearchRequestHandler/_xpath=/sessionWorkflow/productWorkflow[@product='Rail']">
</div>
現時点では、ボタンにこのコードを入力して「alt="クリックしてチケットを検索」を押しています。
For Each webpageelement As HtmlElement In allelements
If webpageelement.GetAttribute("alt") = "Click to Find Tickets" Then
webpageelement.InvokeMember("click")
End If
それは機能しますが、問題は、そのaltを使用する別の領域がWebサイトにあることです。したがって、ユーザー名とパスワードの入力を求められます。私のコード行は現在ボタンの中にあります。