Last active
July 1, 2022 06:35
-
-
Save ALiwoto/5a032128a818e964185c712bef046d16 to your computer and use it in GitHub Desktop.
parsing detailed-drop-down-select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select aria-label="Instance" class="detailed-dropdown select" name="size"> | |
<option value="a0">A0: 1 Cores, 0.75 GB RAM, 20 GB Temporary storage, $0.020/hour</option> | |
<option value="a1">A1: 1 Cores, 1.75 GB RAM, 70 GB Temporary storage, $0.090/hour</option> | |
<option value="a2">A2: 2 Cores, 3.5 GB RAM, 135 GB Temporary storage, $0.180/hour</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_str = open('detailed-drop-down-select.html', 'r').read() | |
my_strs = my_str.split('</option>')[1:] | |
with open('final_list.txt', 'a') as f: | |
for current in my_strs: | |
current = current.strip() | |
tmp_strs = current.split('">') | |
if len(tmp_strs) > 1: | |
f.write(tmp_strs[1] + '\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment