我有一个要自动输入数据的Web表单

时间:2019-07-05 09:17:12

标签: excel vba parsing webautomation

我正在编写一些代码来自动执行来自excel的Web表单填充。它们工作正常,但是当我对其应用逻辑时,它们就会停止。

Option Explicit

Public Sub sel_udise()
    Dim bot As New WebDriver
    bot.Start "chrome", ""
    bot.Get "https://student.udise.in/"
    bot.Wait (500)
    bot.FindElementById("txtUserName").SendKeys "XXXXXXXX"
    bot.FindElementById("txtPassword").SendKeys "XXXXXXXX"
    bot.FindElementById("btnSubmit").Click
    bot.Get "https://student.udise.in/Userscreens/Profilenew4.aspx"
    Dim y As Integer
    Dim a, b, c, d, cSCRIPT
     For y = 8 To 10
    ' For Nyaya panchayat
     a = ThisWorkbook.Sheets("sheet3").Range("Av" & y).Text
     b = ThisWorkbook.Sheets("sheet3").Range("Av" & y - 1).Text
     'If a <> b Then
    bot.FindElementById("ctl00_ContentPlaceHolder1_ddlCluster").SendKeys [a]
    'End If
    bot.Wait (3000)
    ' For school
    c = ThisWorkbook.Sheets("sheet3").Range("AU" & y).Value
    d = ThisWorkbook.Sheets("sheet3").Range("AU" & y - 1).Value
    'If c <> d Then
    bot.FindElementById("ctl00_ContentPlaceHolder1_ddlschool").SendKeys [c]
    'End If
    bot.Wait (3000)
    next y
end sub

0 个答案:

没有答案