MoonPoint Support Logo

 


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
April
Sun Mon Tue Wed Thu Fri Sat
           
5
           
2017
Months
Apr
Aug Sep
Oct Nov Dec


Wed, Apr 05, 2017 10:47 pm

Counting queued items with a Python script

I need to review and approve firewall rule requests. I can get a list of those pending approval, ones requesting a modification to existing rules, those pending removal because they've expired (all rules must be reviewed on at least a yearly basis), ones on hold, ones that are in a "clarification required" state due to a question about the rules being requested, those approved for implementation, but not yet implemented, and those awaiting removal. But the page that displays the requests in each category doesn't give me a count of the number in each category, so I wrote a Python script that will read the webpage containing that information that I've downloaded, parse the HTML code for the page and give me a count of the number of requests in each category.

The script is named count_queued.py . The name of the HTML file that was downloaded should be provided on the command line. E.g.:

$ ./count_queued.py ~/Documents/Work/queued/Request.html
Request Status

Pending Approval:       69
Modified:               36
Pending Removal         43
On Hold:                0
Clarification Required: 28
Waiting Implementation: 26
Waiting Removal:        12

Total requiring review: 176
$

[ More Info ]

[/languages/python] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo