我正在尝试点击网站上的某个按钮。这是它的代码。
<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。因此,它要求输入用户名和密码。我的代码行现在是一个按钮。