[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[问题求助] 【己解决】求大神帮忙编写一个VBS文件提取网页内容

求大神帮忙编写一个VBS文件提取网页内容:

网页上有类似表格的页面,想求一个VBS来显示计算网页上的加班信息,
具体提取内容:
<td class="nbtext" width="70px">06:52</td>
<td class="nbtext" width="70px">06:52</td>[attach]8550[/attach]
<td width="70px" class="nbtext"><FONT color=white>工时类别</FONT></td>
里的时间"06:82","3.00","工时类别" 这些内容(双引号内的内容) 用来计算下面几个项目.

详细内容:
可以计算出:
缺勤: ????
迟到: ????
早退: ????
实际工作时间: ???
平日加班: ????
公休日加班: ????
加班单小时1:  ???
审核加班小时1 ???
休假类别+休假小时: ????

贴出Html原文件:
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2
☆★I wait for you!☆★

回复 2# yu2n


        谢谢老师!
        我并不是想用 VBS 代码去计算, 考勤系统会自动计算这些数据,我只想通过这种方法练习如何抓取网页内需要的信息.
        通过昨天至今天的努力,已基本解决了数据提取的问题.
        我是用了很笨的方法去提取这些数据的, 不知道有没有更好的方法更准确的获取这些数据?
        基本上是靠下面两句一个一个的去抓取的........
  1. f.WriteLine("CHname=ie.document.getElementById(""_ctl10"").value")
  2. RomText12 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(12),""</td>"")(0),""&nbsp;"",""0"")
复制代码
☆★I wait for you!☆★

TOP

这是我自己写的代码:
也不知道是否如有不妥或者可以优化的地方;
已经实现了当前需求功能.
还望老师们赐教;
  1. Dim US,PW
  2. US=Inputbox("Please input your user name:","Input User Name","",0,0)
  3. if IsEmpty(US) then
  4. wscript.quit
  5. else
  6. PW=Inputbox ("Please input your Password:","Input Password","",0,0)
  7. if IsEmpty(PW) then
  8. else
  9. MyVar = MsgBox ("Please confirm if need delete itself by program:"&vbCrlf&"If answer is yes, Please click button <Yes> "&vbCrlf&"If answer is no, Please click button <No>.", 65, "Function of delete itself")
  10. if MyVar=1 then
  11. Call CDelFile
  12. else
  13. Call CFile
  14. end if
  15. end if
  16. end if
  17. Dim WshShell  
  18. Set WshShell=WScript.CreateObject("WScript.Shell")  
  19. WshShell.Run "D:\Automatic.Query.Attendance.Data.vbs"
  20. Sub CFile
  21. Dim fso, f
  22. set fso = CreateObject("Scripting.FileSystemObject")
  23. set f = fso.CreateTextFile("D:\Automatic.Query.Attendance.Data.vbs",true)
  24. f.WriteLine("Set ie = CreateObject(""InternetExplorer.Application"") ")
  25. f.WriteLine("ie.navigate ""http://huahr02/essusergz/""")
  26. f.WriteLine("While ie.busy Or ie.readystate <> 4")
  27. f.WriteLine("Wend ")
  28. f.WriteLine("ie.document.getElementById(""txtUserID"").value = """&US&"""")
  29. f.WriteLine("ie.document.getElementById(""txtPassword"").value = """&PW&"""")
  30. f.WriteLine("ie.document.getElementById(""btnLogon"").click")
  31. f.WriteLine("While ie.busy Or ie.readystate <> 4")
  32. f.WriteLine("Wend ")
  33. f.WriteLine("ie.navigate ""http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx""")
  34. f.WriteLine("While ie.busy Or ie.readystate <> 4")
  35. f.WriteLine("Wend ")
  36. f.WriteLine("Startdate=ie.document.getElementById(""dbxBegin:Cal_txtLeft"").value")
  37. f.WriteLine("Enddate=ie.document.getElementById(""dbxEnd:Cal_txtLeft"").value")
  38. f.WriteLine("SAPnum=ie.document.getElementById(""_ctl4"").value")
  39. f.WriteLine("Num=ie.document.getElementById(""_ctl7"").value")
  40. f.WriteLine("CHname=ie.document.getElementById(""_ctl10"").value")
  41. f.WriteLine("ENname=ie.document.getElementById(""_ctl13"").value")
  42. f.WriteLine("DPname=ie.document.getElementById(""_ctl16"").value")
  43. f.WriteLine("WCname=ie.document.getElementById(""_ctl19"").value")
  44. f.WriteLine("CCname=ie.document.getElementById(""_ctl22"").value")
  45. f.WriteLine("Joindate=ie.document.getElementById(""_ctl26"").value")
  46. f.WriteLine("Leavedate=ie.document.getElementById(""_ctl29"").value")
  47. f.WriteLine("Worknum=ie.document.getElementById(""_ctl32"").value")
  48. f.WriteLine("MidWorknum=ie.document.getElementById(""_ctl35"").value")
  49. f.WriteLine("NightWorknum=ie.document.getElementById(""_ctl38"").value")
  50. f.WriteLine("TOT=ie.document.getElementById(""_ctl41"").value")
  51. f.WriteLine("Dim strText")
  52. f.WriteLine("with CreateObject(""MSXml2.xmlhttp"")")
  53. f.WriteLine(".Open ""GET"",""C:\Users\Harris\Desktop\Attendence Detail.htm"",false")
  54. f.WriteLine(".Send")
  55. f.WriteLine("strText = ByteToStr(.Responsebody)")
  56. f.WriteLine("end with")
  57. f.WriteLine("Function ByteToStr(ByVal arrByte)")
  58. f.WriteLine("With CreateObject(""Adodb.Stream"")")
  59. f.WriteLine(".Type = 1")
  60. f.WriteLine(".Open")
  61. f.WriteLine(".Write arrByte")
  62. f.WriteLine(".Position = 0")
  63. f.WriteLine(".Type = 2")
  64. f.WriteLine(".Charset = ""GB2312""")
  65. f.WriteLine("ByteToStr = .Readtext")
  66. f.WriteLine(".Close")
  67. f.WriteLine("End With")
  68. f.WriteLine("End Function")
  69. f.WriteLine("RomText12 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(12),""</td>"")(0),""&nbsp;"",""0"")")
  70. f.WriteLine("RomText13 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(13),""</td>"")(0),""&nbsp;"",""0"")")
  71. f.WriteLine("RomText14 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(14),""</td>"")(0),""&nbsp;"",""0"")")
  72. f.WriteLine("RomText15 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(15),""</td>"")(0),""&nbsp;"",""0"")")
  73. f.WriteLine("RomText17 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(17),""</td>"")(0),""&nbsp;"",""0"")")
  74. f.WriteLine("RomText18 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(18),""</td>"")(0),""&nbsp;"",""0"")")
  75. f.WriteLine("RomText23 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(23),""</td>"")(0),""&nbsp;"",""0"")")
  76. f.WriteLine("msgbox ""Chinese Name:    ""&CHname&vbCrlf&""English Name:      ""&ENname&vbCrlf&""SAP Number:       ""&SAPnum&vbCrlf&""Employee Name: ""&num&vbCrlf&""Department:    ""&DPname&vbCrlf&""Work Cell:           ""&WCname&vbCrlf&""Cost Center:       ""&CCname&vbCrlf&""-----------------------------------------------""&vbCrlf&""Join Date:     ""&Joindate&vbCrlf&""Leave Date:   ""&Leavedate&vbCrlf&""Start Date:   ""&Startdate&vbCrlf&""End Date:     ""&Enddate&vbCrlf&""-----------------------------------------------""&vbCrlf&""Work Days:    ""&Worknum&"" Days""&vbCrlf&""B Shifts Days: ""&MidWorknum&"" Days""&vbCrlf&""C Shifts Days: ""&NightWorknum&"" Days""&vbCrlf&""-----------------------------------------------""&vbCrlf&""OT Upper Limit: ""&TOT&"" Hours""&vbCrlf&""-----------------------------------------------""&vbCrlf&""Absenteeism: ""&RomText12&"" h""&vbCrlf&""Late: ""&RomText13&"" h""&vbCrlf&""Leave Early: ""&RomText14&"" h""&vbCrlf&""Actual working hours: ""&RomText15&"" h""&vbCrlf&""Apply Over Time: ""&RomText17&"" h""&vbCrlf&""Actual Over Time: ""&RomText18&"" h""&vbCrlf&""Vacation Hours: ""&RomText23&"" h"",0,""Query results: Make By HB Huang""")
  77. f.WriteLine("wscript.quit")
  78. f.Close()
  79. set f = nothing
  80. set fso = nothing
  81. End Sub
  82. Sub CDelFile
  83. Dim fso, f
  84. set fso = CreateObject("Scripting.FileSystemObject")
  85. set f = fso.CreateTextFile("D:\Automatic.Query.Attendance.Data.vbs",true)
  86. f.WriteLine("Set ie = CreateObject(""InternetExplorer.Application"") ")
  87. f.WriteLine("ie.navigate ""http://huahr02/essusergz/""")
  88. f.WriteLine("While ie.busy Or ie.readystate <> 4")
  89. f.WriteLine("Wend ")
  90. f.WriteLine("ie.document.getElementById(""txtUserID"").value = """&US&"""")
  91. f.WriteLine("ie.document.getElementById(""txtPassword"").value = """&PW&"""")
  92. f.WriteLine("ie.document.getElementById(""btnLogon"").click")
  93. f.WriteLine("While ie.busy Or ie.readystate <> 4")
  94. f.WriteLine("Wend ")
  95. f.WriteLine("ie.navigate ""http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx""")
  96. f.WriteLine("While ie.busy Or ie.readystate <> 4")
  97. f.WriteLine("Wend ")
  98. f.WriteLine("Startdate=ie.document.getElementById(""dbxBegin:Cal_txtLeft"").value")
  99. f.WriteLine("Enddate=ie.document.getElementById(""dbxEnd:Cal_txtLeft"").value")
  100. f.WriteLine("SAPnum=ie.document.getElementById(""_ctl4"").value")
  101. f.WriteLine("Num=ie.document.getElementById(""_ctl7"").value")
  102. f.WriteLine("CHname=ie.document.getElementById(""_ctl10"").value")
  103. f.WriteLine("ENname=ie.document.getElementById(""_ctl13"").value")
  104. f.WriteLine("DPname=ie.document.getElementById(""_ctl16"").value")
  105. f.WriteLine("WCname=ie.document.getElementById(""_ctl19"").value")
  106. f.WriteLine("CCname=ie.document.getElementById(""_ctl22"").value")
  107. f.WriteLine("Joindate=ie.document.getElementById(""_ctl26"").value")
  108. f.WriteLine("Leavedate=ie.document.getElementById(""_ctl29"").value")
  109. f.WriteLine("Worknum=ie.document.getElementById(""_ctl32"").value")
  110. f.WriteLine("MidWorknum=ie.document.getElementById(""_ctl35"").value")
  111. f.WriteLine("NightWorknum=ie.document.getElementById(""_ctl38"").value")
  112. f.WriteLine("TOT=ie.document.getElementById(""_ctl41"").value")
  113. f.WriteLine("Dim strText")
  114. f.WriteLine("with CreateObject(""MSXml2.xmlhttp"")")
  115. f.WriteLine(".Open ""GET"",""C:\Users\Harris\Desktop\Attendence Detail.htm"",false")
  116. f.WriteLine(".Send")
  117. f.WriteLine("strText = ByteToStr(.Responsebody)")
  118. f.WriteLine("end with")
  119. f.WriteLine("Function ByteToStr(ByVal arrByte)")
  120. f.WriteLine("With CreateObject(""Adodb.Stream"")")
  121. f.WriteLine(".Type = 1")
  122. f.WriteLine(".Open")
  123. f.WriteLine(".Write arrByte")
  124. f.WriteLine(".Position = 0")
  125. f.WriteLine(".Type = 2")
  126. f.WriteLine(".Charset = ""GB2312""")
  127. f.WriteLine("ByteToStr = .Readtext")
  128. f.WriteLine(".Close")
  129. f.WriteLine("End With")
  130. f.WriteLine("End Function")
  131. f.WriteLine("RomText12 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(12),""</td>"")(0),""&nbsp;"",""0"")")
  132. f.WriteLine("RomText13 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(13),""</td>"")(0),""&nbsp;"",""0"")")
  133. f.WriteLine("RomText14 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(14),""</td>"")(0),""&nbsp;"",""0"")")
  134. f.WriteLine("RomText15 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(15),""</td>"")(0),""&nbsp;"",""0"")")
  135. f.WriteLine("RomText17 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(17),""</td>"")(0),""&nbsp;"",""0"")")
  136. f.WriteLine("RomText18 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(18),""</td>"")(0),""&nbsp;"",""0"")")
  137. f.WriteLine("RomText23 = Replace(Split(Split(strText,""<td class=""""nbtext"""" style=""""COLOR:white"""" width=""""70px"""">"")(23),""</td>"")(0),""&nbsp;"",""0"")")
  138. f.WriteLine("msgbox ""Chinese Name:    ""&CHname&vbCrlf&""English Name:      ""&ENname&vbCrlf&""SAP Number:       ""&SAPnum&vbCrlf&""Employee Name: ""&num&vbCrlf&""Department:    ""&DPname&vbCrlf&""Work Cell:           ""&WCname&vbCrlf&""Cost Center:       ""&CCname&vbCrlf&""-----------------------------------------------""&vbCrlf&""Join Date:     ""&Joindate&vbCrlf&""Leave Date:   ""&Leavedate&vbCrlf&""Start Date:   ""&Startdate&vbCrlf&""End Date:     ""&Enddate&vbCrlf&""-----------------------------------------------""&vbCrlf&""Work Days:    ""&Worknum&"" Days""&vbCrlf&""B Shifts Days: ""&MidWorknum&"" Days""&vbCrlf&""C Shifts Days: ""&NightWorknum&"" Days""&vbCrlf&""-----------------------------------------------""&vbCrlf&""OT Upper Limit: ""&TOT&"" Hours""&vbCrlf&""-----------------------------------------------""&vbCrlf&""Absenteeism: ""&RomText12&"" h""&vbCrlf&""Late: ""&RomText13&"" h""&vbCrlf&""Leave Early: ""&RomText14&"" h""&vbCrlf&""Actual working hours: ""&RomText15&"" h""&vbCrlf&""Apply Over Time: ""&RomText17&"" h""&vbCrlf&""Actual Over Time: ""&RomText18&"" h""&vbCrlf&""Vacation Hours: ""&RomText23&"" h"",0,""Query results: Make By HB Huang""")
  139. f.WriteLine("set copy1=createobject(""scripting.filesystemobject"")")
  140. f.WriteLine("copy1.getfile(wscript.scriptfullname).delete")
  141. f.WriteLine("wscript.quit")
  142. f.Close()
  143. set f = nothing
  144. set fso = nothing
  145. End Sub
复制代码
☆★I wait for you!☆★

TOP

回复 2# yu2n

公司的考勤系统是需要登录的,
     登录页面: http://huahr02/essusergz/
     需要获取数据的页面: http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx
     这种情况应该如何去实现呢?????

    刚才在公司试了一下昨天我发的代码, 前面的可以实现, 但是后面的无法取值.

     RomText12 = Replace(Split(Split(strText1,"<td class=""nbtext"" style=""COLOR:white"" width=""70px"">")(1),"</td>")(0),"&nbsp;","0")

    老师,如果我只想获取最后一行数据, 应该用什么语句实现呢? 并且要一个一个的输出.
    比如:   
      实际工作时间: 112.00
      加班单小时1:   53.50
      审核加班小时1: 53.00
      休假小时: 24.00
☆★I wait for you!☆★

TOP

回复 6# yu2n 现在的问题是,公司的考勤系统需要登录,
而我需要获取的数据是登录后的页面(附件里的Html)
登录页面: http://huahr02/essusergz/
登录后的页面:  http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx(附件里的Html)
如何获取数据??
我只要能显示出以下结果就行......
重点是学会思路...........
☆★I wait for you!☆★

TOP

回复 8# yu2n

    你好,用“InternetExplorer.Application”   其实我用现在的方法已经成功登陆并获取了一些有“name”属性值的数据。   但是我不会用现在的方法或取其它没有“name”属性的对象的值,
   所以请大神帮帮忙的.........

登陆并获取一些数据的部分代码:

  1. Set ie = CreateObject("InternetExplorer.Application")
  2. ie.navigate "http://huahr02/essusergz/"
  3. While ie.busy Or ie.readystate <> 4
  4. Wend
  5. ie.document.getElementById("txtUserID").value = Username
  6. ie.document.getElementById("txtPassword").value = Password
  7. ie.document.getElementById("btnLogon").click
  8. While ie.busy Or ie.readystate <> 4
  9. Wend
  10. ie.navigate "http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx" ’等前面页面加载完成后,输入此网址(即可得到需要获取数据的页面)
  11. While ie.busy Or ie.readystate <> 4
  12. Wend
  13. Startdate=ie.document.getElementById("dbxBegin:Cal_txtLeft").value
复制代码
‘获取一个“name”属性为“dbxBegin:Cal_txtLeft”的值。



目前可以“登陆并获取部分数据”的源代码(还可以在运行后Copy自身至D盘。):

  1. set copy1=createobject("scripting.filesystemobject")         
  2. copy1.getfile(wscript.scriptfullname).copy("d:\Automatic Query Attendance Data(EN).vbs")
  3. Username="UserName" 'Replace to your user name
  4. Password="PassWord" 'replace to your password
  5. if username = "UserName" or PassWord = "PassWord" then
  6.      msgbox "UserName: "&UserName&vbcrlf&"PassWord: "&PassWord&vbcrlf,4096,"Pleae check your UserName and Password: "
  7. wscript.quit
  8.      else
  9.      Set ie = CreateObject("InternetExplorer.Application")
  10. ie.navigate "http://huahr02/essusergz/"
  11. While ie.busy Or ie.readystate <> 4
  12. Wend
  13. ie.document.getElementById("txtUserID").value = Username
  14. ie.document.getElementById("txtPassword").value = Password
  15. ie.document.getElementById("btnLogon").click
  16. While ie.busy Or ie.readystate <> 4
  17. Wend
  18. ie.navigate "http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx"
  19. While ie.busy Or ie.readystate <> 4
  20. Wend
  21. Startdate=ie.document.getElementById("dbxBegin:Cal_txtLeft").value
  22. Enddate=ie.document.getElementById("dbxEnd:Cal_txtLeft").value
  23. SAPnum=ie.document.getElementById("_ctl4").value
  24. Num=ie.document.getElementById("_ctl7").value
  25. CHname=ie.document.getElementById("_ctl10").value
  26. ENname=ie.document.getElementById("_ctl13").value
  27. DPname=ie.document.getElementById("_ctl16").value
  28. WCname=ie.document.getElementById("_ctl19").value
  29. CCname=ie.document.getElementById("_ctl22").value
  30. Joindate=ie.document.getElementById("_ctl26").value
  31. Leavedate=ie.document.getElementById("_ctl29").value
  32. Worknum=ie.document.getElementById("_ctl32").value
  33. MidWorknum=ie.document.getElementById("_ctl35").value
  34. NightWorknum=ie.document.getElementById("_ctl38").value
  35. TOT=ie.document.getElementById("_ctl41").value
  36. msgbox "Chinese Name:    "&CHname&vbCrlf&"English Name:      "&ENname&vbCrlf&"SAP Number:       "&SAPnum&vbCrlf&"Employee Name: "&num&vbCrlf&"Department:    "&DPname&vbCrlf&"Work Cell:           "&WCname&vbCrlf&"Cost Center:       "&CCname&vbCrlf&"-----------------------------------------------"&vbCrlf&"Join Date:     "&Joindate&vbCrlf&"Leave Date:   "&Leavedate&vbCrlf&"Start Date:   "&Startdate&vbCrlf&"End Date:     "&Enddate&vbCrlf&"-----------------------------------------------"&vbCrlf&"Work Days:    "&Worknum&" Days"&vbCrlf&"B Shifts Days: "&MidWorknum&" Days"&vbCrlf&"C Shifts Days: "&NightWorknum&" Days"&vbCrlf&"-----------------------------------------------"&vbCrlf&"OT Upper Limit: "&TOT&" Hours"&vbCrlf&"-----------------------------------------------"&vbCrlf,0,"Query results: Make By HB Huang"
  37. msgbox "The wscript file exist in your computer disk D, the program will automatically help  you open the disk D!",VbOnlyOK,"Congratulations!"
  38. ie.navigate "D:\"
  39. wscript.quit
  40. end if
复制代码
☆★I wait for you!☆★

TOP

回复 10# yu2n


    谢谢老师, 根据你的提示,我的代码部分已经完成了, 明天去公司测试下.......
    我的 QQ:284264152  可以加你QQ吗?
☆★I wait for you!☆★

TOP

代码测试出现一点点小问题, 不过现在已经解决了.
谢谢 yu2n 的帮助. Thank you very much!

经过测试,得出一小结论,
  1. tblDetail=ie.document.getElementById("tblDetail").innerHTML
复制代码
语句得到的源码跟用 IE 浏览器
直接看到的源码是不一样的. 怪不得之前一直查找不到正确的数据.
  1. Dim ie
  2. Set ie = CreateObject("InternetExplorer.Application")
  3. ie.navigate "http://huahr02/essusergz/"
  4. While ie.busy Or ie.readystate <> 4
  5. Wend
  6. ie.document.getElementById("txtUserID").value = "用户名"
  7. ie.document.getElementById("txtPassword").value = "密码"
  8. ie.document.getElementById("btnLogon").click
  9. While ie.busy Or ie.readystate <> 4
  10. Wend
  11. ie.navigate "http://huahr02/essusergz/webpages/attendanceinfo_jabil_c.aspx"
  12. While ie.busy Or ie.readystate <> 4
  13. Wend
  14. '===================================================================================
  15. Startdate=ie.document.getElementById("dbxBegin:Cal_txtLeft").value
  16. Enddate=ie.document.getElementById("dbxEnd:Cal_txtLeft").value
  17. SAPNum=ie.document.getElementById("_ctl4").value
  18. MNum=ie.document.getElementById("_ctl7").value
  19. CHname=ie.document.getElementById("_ctl10").value
  20. ENname=ie.document.getElementById("_ctl13").value
  21. DepartmentName=ie.document.getElementById("_ctl16").value
  22. WorkcellName=ie.document.getElementById("_ctl19").value
  23. CostCenter=ie.document.getElementById("_ctl22").value
  24. Joindate=ie.document.getElementById("_ctl26").value
  25. Leavedate=ie.document.getElementById("_ctl29").value
  26. WorkDays=ie.document.getElementById("_ctl32").value
  27. MidShiftNum=ie.document.getElementById("_ctl35").value
  28. NightShiftNum=ie.document.getElementById("_ctl38").value
  29. TOTUpperLimit=ie.document.getElementById("_ctl41").value
  30. '===================================================================================
  31. tblDetail=ie.document.getElementById("tblDetail").innerHTML
  32. RomText12 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(12),"</TD>")(0),"&nbsp;","0")
  33. RomText13 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(13),"</TD>")(0),"&nbsp;","0")
  34. RomText14 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(14),"</TD>")(0),"&nbsp;","0")
  35. RomText15 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(15),"</TD>")(0),"&nbsp;","0")
  36. RomText17 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(17),"</TD>")(0),"&nbsp;","0")
  37. RomText18 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(18),"</TD>")(0),"&nbsp;","0")
  38. RomText23 = Replace(Split(Split(tblDetail,"<TD style=""COLOR: white"" class=nbtext width=70>")(23),"</TD>")(0),"&nbsp;","0")
  39. msgbox "Chinese Name:     "&CHName&vbCrlf&"English Name:       "&ENName&vbCrlf&"SAP Number:        "&SAPNum&vbCrlf&"Employee Name:   "&MNum&vbCrlf&"Department:          "&DepartmentName&vbCrlf&"Work Cell:              "&WorkcellName&vbCrlf&"Cost Center:          "&CostCenter&vbCrlf&"-----------------------------------------------"&vbCrlf&"Join Date:      "&JoinDate&vbCrlf&"Start Date:    "&StartDate&vbCrlf&"End Date:      "&EndDate&vbCrlf&"-----------------------------------------------"&vbCrlf&"Work Days:      "&WorkDays&" Days"&vbCrlf&"B Shifts Days:   "&MidShiftNum&" Days"&vbCrlf&"C Shifts Days:   "&NightShiftNum&" Days"&vbCrlf&"-----------------------------------------------"&vbCrlf&"OT Upper Limit:   "&TOTUpperLimit&" Hours"&vbCrlf&"-----------------------------------------------"&vbCrlf&"Absenteeism:    "&RomText12&" h"&vbCrlf&"Late:                 "&RomText13&" h"&vbCrlf&"Leave Early:     "&RomText14&" h"&vbCrlf&"Actual working hours:   "&RomText15&" h"&vbCrlf&"Apply Over Time:          "&RomText17&" h"&vbCrlf&"Actual Over Time:         "&RomText18&" h"&vbCrlf&"Vacation Hours:            "&RomText23&" h",0,"Query results: Make By HB Huang"
  40. set ie=nothing
  41. wscript.quit
复制代码
☆★I wait for you!☆★

TOP

返回列表