나눔터  
  HOME > 나눔터 > 묻고답하기 > 엑셀
엑셀
엑셀에 대한 질문과 답변을 올려주세요. 단, 취지에 맞지 않는 글은 운영자가 삭제합니다.
 "000 님, 도와주세요", "부탁 드립니다.", "급합니다!" 등과 같이 막연한 제목을 달지 말아주세요.
[필독] 빠르고 정확한 답변을 얻는 16가지 Tip !
[필독] 저작권법 개정에 따른 이용안내

작성자:  

 speena (speena)

추천:  2
파일:     조회:  1713
제목:   VBA웹사이트클릭
     
  id=dspStoreSelectListDto0 form name="storeSelectActionForm" id="submitForm_0"
id=dspStoreSelectListDto1 form name="storeSelectActionForm" id="submitForm_1"
id=dspStoreSelectListDto2 form name="storeSelectActionForm" id="submitForm_2"
id=dspStoreSelectListDto3 form name="storeSelectActionForm" id="submitForm_3"
id=dspStoreSelectListDto4 form name="storeSelectActionForm" id="submitForm_4"

submitForm_0을 누르려면 어떻게 해야 하나요.
로그인이 필요한사이트라 일단 vba로 로그인까지는 됐는데
선택이 안되네요 공부부족이라 알려주시면 감사하겠습니다.

----------------

<tr id="dspStoreSelectListDto0"class="item">
<td>
<form name="storeSelectActionForm" id="submitForm_0" method="POST" action="/CLN/storeSelect/" autocomplete="off">
<input type="hidden" name="storeId" value="H00000001">
<a href="javascript:$('#submitForm_0').attr('action' , '/CLN/topMenu/').submit()">name1234</a>
</form>
</td>
<td>

</td>
<td>
2020/1/24
<br />
SSP
</td>
<td>
2020/1/24
<br />
ABC
</td>
</tr>
<tr id="dspStoreSelectListDto1" class="item">
<td>
<form name="storeSelectActionForm" id="submitForm_1" method="POST" action="/CLN/storeSelect/" autocomplete="off">
----------------
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub get3(cnt As Integer)
    'On Error GoTo ErrHandler        ' 
    Dim objIE As InternetExplorer   ' 
    Set objIE = New InternetExplorer
    
   
    Dim userID As String            ' ID
    Dim password As String          ' PW
    Dim month As String             ' 
    
     userID = "***"
     password = "***"
    'month = Cells(month_col, month_row).Value       
     
    Dim tmp As Variant
    Dim tmp2 As Variant
     
   
    If userID = "" Then
        Exit Sub
    End If

    objIE.Visible = True
    objIE.navigate "https://******" '
    
    Call WaitIE3(objIE)
    Dim htmlDoc As HTMLDocument
    Set htmlDoc = objIE.document
    
    ' 1.
    With htmlDoc
        .getElementById("userId").Value = userID     ' 
        .getElementById("password").Value = password   ' 
    End With

    Dim inputTags As IHTMLElementCollection
    Set inputTags = htmlDoc.getElementsByTagName("input")
    Dim inputTag As IHTMLElement
    For Each inputTag In inputTags
        If inputTag.alt = "login" Then
            inputTag.Click ' 
            Exit For
        End If
    Next
    
    ' 2.slect

    Dim nnn As Long
   For nnn = 0 To 3
        For Each inputTag2 In objIE.document.getElementsByTagName("storeSelectActionForm"&nnn)                         
        If inputTag2.alt = "submitForm_"&nnn Then
          inputTag2.Click ' 
         Exit For
       ' End If
     Next
     
     

        
   Next

    End Sub

Sub WaitIE3(objIE As InternetExplorer)
    Do While objIE.Busy = True Or objIE.readyState < 4 '
        '4=READYSTATE_COMPLETE
        DoEvents
    Loop
End Sub
    
 
[불량 게시물 신고]  
        
  

작성일 : 2020-02-05(14:32)
최종수정일 : 2020-02-05(14:33)