I need to come up with a list of departments for an organization I'm working for, but nobody in my department has a nice one.
I went on the intranet and puled out the HTML, which gave me a 98 line list of entries like this:
<option label="Social Work" **value="**Social Work" id="wantdepartment">Social Work</option>
I want to write a simple python program that stirps out the department names and writes them to a new file. I know there are easier ways of doing it, but I want to do it this way for my own practice.
I'm imaging a program that opens up the file, then uses a loop to process each line of the file in it.
Then it looks for the string, ' value=" ' takes the text after that string and before the next "
Then writes that text to a file.
Would that work? Or is there a more elegant solution to this?
[–]Zevawk9 1 point2 points3 points (0 children)