Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help Trying To Parse and Update Html Page

$
0
0

I have a project that I am working on in which I am trying to do the following:

1. Open project page "in background"

2. Read values to see if criteria is there

3. Set values above as variable to be written to file

4. Be able to update one or several of those values in the background as well and save the page "mediawiki" in the background un-noticeable to the user.

 

 

I do not code written for this part yet as I am confused on where to start. I've read about "reg ex" "_IEgetsource" and all the parsing html posts on the forums, I just don't understand it.

 

I will post below the html code in question and the values that I am trying to retrieve. Right now I have another script that the user has to manually look at this page and copy and paste these values into my script to auto generate the file.  I thought well thats stupid it's already there there has to be a way to be able to just read it from the webpage automatically, this would prevent user error in typo'ing something.

 

The Values I'm interested in are as follows:

This is viewed as a table in IE with one side being A. and the other side being Z.  Everything under #1 needs to be viewed as a value for "Z" side as well.  Any help would be greatly appreciated.

 

1. Circuit ID

 

2.A-Location

3. Z-Location

4. A-Side Next Step

5. A-Side Assigned Eng

6. A-Side Router

7. A-Side Interface

8. A-Side IP Address

9. Location

10. FPC (HW ID #1)

11. PIC (HW ID #2)

12. Optics (HW ID #3)

13. TAM

14 .TOM

15. Bypass A Port

16. Install ECM

17. Install Date

18. testing IP Address

19. Traffic Add ECM

20. Traffic Add Date:

21. Shipment #1 Tracking Number

22. Shipment #2 Tracking Number

23. Shipment #3 Tracking Number

24. Facility Inbound Shipment Ticket

 

 

 

 

HTML Source Below

HTML         
<tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <big><b>Next Step (Overall Status)</b>: Assessment</big> </td></tr> <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>Target Completion Date</b>: </td></tr> <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>Project Overview</b>: </td></tr> <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>Project Notes</b>:{{{ProjectNotes}}} </td></tr>   <tr> <td align="center" bgcolor="#f4a460" colspan="2"> <big><b>Technical Information</b></big> </td></tr> <tr> <td align="left" bgcolor="#F5FAFF"> <b>Priority</b>: 88% </td><td align="left" bgcolor="#F5FAFF"> <b>Requires New Fate Sharing:</b> </td></tr> <tr> <td align="left" bgcolor="#F5FAFF"> <b>Project Open Date</b>: 2013-Q2 </td><td align="left" bgcolor="#F5FAFF"> <b>Opened in Response to Failure</b>: N/A </td></tr> <tr> <td align="left" bgcolor="#F5FAFF"> <b>Type of Project</b>: </td><td align="left" bgcolor="#F5FAFF"> <b>Link To Cariden Plan</b>: {{{LinkToCaridenPlan}}} </td></tr> <tr> <td align="left" bgcolor="#F5FAFF"> <b>Circuit ID</b>: 13013.GE10.KSCYMOAVJAW.OKCYOKEZJBW </td><td> </td></tr> <tr> <th align="center" bgcolor="#99ccff" width="50%"> <big><b>A-Location</b>: KSCYBBRJ01</big> </th><th align="center" bgcolor="#fffccf" width="50%"> <big><b>Z-Location</b>: MTC3BBRJ02</big> </th></tr> <tr> <th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Backbone</b></small> </th><th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Backbone</b></small> </th></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>A-Side Next Step</b>: </td><td align="left" bgcolor="#fffccf"> <b>Z-Side Next Step</b>: Assessment </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>A-Side Assigned Eng</b>: TCovert </td><td align="left" bgcolor="#fffccf"> <b>Z-Side Assigned Eng</b>: Roger </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Router</b>: KSCYBBRJ01 </td><td align="left" bgcolor="#fffccf"> <b>Router</b>: MTC3BBRJ02 </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Interface</b>: xe-3/0/8 </td><td align="left" bgcolor="#fffccf"> <b>Interface</b>: xe-3/1/4 </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>OSPF Metric</b>: </td><td align="left" bgcolor="#fffccf"> <b>OSPF Metric</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>IP Address</b>: 68.1.1.192 </td><td align="left" bgcolor="#fffccf"> <b>IP Address</b>: 68.1.1.193 </td></tr> <tr> <th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Transport</b></small> </th><th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Transport</b></small> </th></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Location</b>: KSCY-15-A-1-1-5 </td><td align="left" bgcolor="#fffccf"> <b>Location</b>: OKC-15-A-5-2-1 </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Budget/Project Code</b>: </td><td align="left" bgcolor="#fffccf"> <b>Budget/Project Code</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Transport Notes</b>: </td><td align="left" bgcolor="#fffccf"> <b>Transport Notes</b>: </td></tr>   <tr> <td align="center" bgcolor="#f4a460" colspan="2"><big><b>Hardware Requirements</b></big> </td></tr> <tr> <th align="center" bgcolor="#99ccff" width="50%"> <big><b>A-Location</b>: KSCYBBRJ01</big> </th><th align="center" bgcolor="#fffccf" width="50%"> <big><b>Z-Location</b>: MTC3BBRJ02</big> </th></tr> <tr> <th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Backbone</b></small> </th><th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Backbone</b></small> </th></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>POC</b>: </td><td align="left" bgcolor="#fffccf"> <b>POC</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Chassis Type</b>: T1600 </td><td align="left" bgcolor="#fffccf"> <b>Chassis Type</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>FPC (HW ID #1)</b>: </td><td align="left" bgcolor="#fffccf"> <b>FPC (HW ID #1)</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>FPC Serial Number</b>: </td><td align="left" bgcolor="#fffccf"> <b>FPC Serial Number</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>PIC (HW ID #2)</b>: </td><td align="left" bgcolor="#fffccf"> <b>PIC (HW ID #2)</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>PIC Serial Number</b>: </td><td align="left" bgcolor="#fffccf"> <b>PIC Serial Number</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Optics (HW ID #3)</b>: </td><td align="left" bgcolor="#fffccf"> <b>Optics (HW ID #3)</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Optics Serial Number</b>: </td><td align="left" bgcolor="#fffccf"> <b>Optics Serial Number</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Connector</b>: </td><td align="left" bgcolor="#fffccf"> <b>Connector</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Fiber Jumper (HW ID #4)</b>: </td><td align="left" bgcolor="#fffccf"> <b>Fiber Jumper (HW ID #4)</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Additional Hardware</b>: </td><td align="left" bgcolor="#fffccf"> <b>Additional Hardware</b>: </td></tr> <tr> <th align="center" bgcolor="#e7eef6" width="50%"> <small><b>Transport</b></small> </th><th align="center" width="50%"> <small><b>Transport</b></small> </th></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>TAM</b>:NONE </td><td align="left" bgcolor="#fffccf"> <b>TAM</b>:TIM </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>TOM</b>:NONE </td><td align="left" bgcolor="#fffccf"> <b>TOM</b>:SFP </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Transport Serial Numbers</b>: </td><td align="left" bgcolor="#fffccf"> <b>Transport Serial Numbers</b>: </td></tr>   <tr> <td align="center" bgcolor="#f4a460" colspan="2"><big><b>Network Intelligence</b></big> </td></tr> <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>Bypass Name</b>: </td></tr> <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>Bypass IP</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Bypass A Port</b>: </td><td align="left" bgcolor="#fffccf"> <b>Bypass Z Port</b>: </td></tr>   <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>DPI Name</b>: </td></tr> <tr> <td align="center" bgcolor="#e7eef6" colspan="2"> <b>DPI IP</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>DPI A Port</b>: </td><td align="left" bgcolor="#fffccf"> <b>DPI Z Port</b>: </td></tr>   <tr> <td align="center" bgcolor="#f4a460" colspan="2"> <big><b>Maintenance Information</b></big> </td></tr> <tr> <th align="center" bgcolor="#99ccff" width="50%"> <big><b>A-Location</b>: KSCYBBRJ01</big> </th><th align="center" bgcolor="#fffccf" width="50%"> <big><b>Z-Location</b>: MTC3BBRJ02</big> </th></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Install ECM</b>: </td><td align="left" bgcolor="#fffccf"> <b>Install ECM</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Install Date</b>: </td><td align="left" bgcolor="#fffccf"> <b>Install Date</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Testing IP Address</b>:INSERT_TEST_IP_HERE </td><td align="left" bgcolor="#fffccf"> <b>Testing IP Address</b>:INSERT_TEST_IP_HERE </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Traffic Add ECM</b>: </td><td align="left" bgcolor="#fffccf"> <b>Traffic Add ECM</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Traffic Add Date</b>: </td><td align="left" bgcolor="#fffccf"> <b>Traffic Add Date</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Peering Maintenance Ticket</b>: </td><td align="left" bgcolor="#fffccf"> <b>Peering Maintenance Ticket</b>: </td></tr>   <tr> <td align="center" bgcolor="#f4a460" colspan="2"> <big><b>Shipping Information</b></big> </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Shipment #1 Tracking Number</b>: </td><td align="left" bgcolor="#fffccf"> <b>Shipment #1 Tracking Number</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Shipment #2 Tracking Number</b>: </td><td align="left" bgcolor="#fffccf"> <b>Shipment #2 Tracking Number</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Shipment #3 Tracking Number</b>: </td><td align="left" bgcolor="#fffccf"> <b>Shipment #3 Tracking Number</b>: </td></tr> <tr> <td align="left" bgcolor="#99ccff"> <b>Facility Inbound Shipment Ticket</b>: </td><td align="left" bgcolor="#fffccf"> <b>Facility Inbound Shipment Ticket</b>: </td></tr></table> </div> <div style="clear:both;"></div></div>  

Auto-It Code For Parsing Here here:

AutoIt         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 507, 338, 575, 483) $CoxLabel = GUICtrlCreateLabel("Email Notification ", 176, 8, 262, 41) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") $C4CoreProjectTypeRadio = GUICtrlCreateRadio("C4 Core Link", 30, 118, 105, 17) $RdcProjectTypeRadio = GUICtrlCreateRadio("RDC Interconnect", 30, 94, 105, 17) $TypeofProjectLabel = GUICtrlCreateLabel("Please Choose The Type Of Project This Is", 22, 70, 249, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $SystemProjectTypeRadio = GUICtrlCreateRadio("System Connection", 30, 142, 113, 17) $ProjectNameLabel = GUICtrlCreateLabel("Please Input Your Project Name", 22, 174, 185, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $ProjectNameInputBox = GUICtrlCreateInput("", 30, 206, 193, 21) $NumberOfProjectsLabel = GUICtrlCreateLabel("Please Input The Number Of Projects You Have Of This Kind", 14, 238, 349, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $NumberOfProjectsInput = GUICtrlCreateInput("", 38, 262, 193, 21) $SubmitButton = GUICtrlCreateButton("Submit", 398, 286, 89, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd

The idea being that a tech would enter a project name IE: CHGO-KSCY-01A-Q2-2013, and the number of projects IE4 and select the type of project and hit submit.

 

When that happens it would take the value of project name and add it to the end of a URL and grab all the data above and depending on which type of project that would be given a different email to be sent out.  I have all that code written already. Just need to grab all the data rather than manually enter it.

 

 

Auto-It Code for Updater Here:


AutoIt         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 504, 550, 856, 161) $CoxLabel = GUICtrlCreateLabel("Wiki Updater", 176, 8, 188, 41) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") $TypeofProjectLabel = GUICtrlCreateLabel("", 22, 70, 4, 4) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $NumberOfProjectsLabel = GUICtrlCreateLabel("Please Input The Number Of Projects You Have Of This Kind", 14, 206, 349, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $NumberOfProjectsInput = GUICtrlCreateInput("", 38, 230, 145, 21) $SubmitButton = GUICtrlCreateButton("Submit", 398, 286, 89, 33) $Label1 = GUICtrlCreateLabel("Which Side Of The Project Do You Have?", 24, 152, 243, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Aside = GUICtrlCreateRadio("A Side", 24, 176, 49, 17) $Zside = GUICtrlCreateRadio("Z Side", 104, 176, 49, 17) $ProjectNameInputBox = GUICtrlCreateInput("", 42, 112, 145, 21) $ProjectNameLabel = GUICtrlCreateLabel("Please Input Your Project Name", 26, 80, 185, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Input Information To Update", 31, 266, 164, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlCreateInput("Project Engineer", 40, 296, 145, 21) GUICtrlCreateInput("Project Status", 42, 327, 145, 21) GUICtrlCreateInput("Install ECM", 44, 355, 145, 21) GUICtrlCreateInput("Install Date", 43, 386, 145, 21) GUICtrlCreateInput("Traffic Add ECM", 40, 418, 145, 21) GUICtrlSetTip(-1, "Project Engineer") GUICtrlCreateInput("Traffic Add Date", 40, 450, 145, 21) GUICtrlCreateInput("Shipping #1", 42, 481, 145, 21) GUICtrlCreateInput("Shipping #2", 40, 512, 145, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>