I'm tying to extract each link that has dungeon separate them and add each link to a list and remove the duplicates I'm sure I separate them removing the duplicates will be easy I have a feeling its something simple I'm missing I would give the site but it requires an account
This is what I got it grabs them but its one big string how do I separate them into a list so i can pick each one out I will be clicking them later. or is there a better way to filter out links with "dungeon" in them using xpath link text don't work
for elem in elems:
if "dungeon" in elem.get_attribute("href"):
list = elem.get_attribute("href")
print(list)
print(list[0])
and this is the output
javascript:dungeon(0,84579684);
j
javascript:dungeon(0,84579684);
j
javascript:dungeon(0,84579674);
j
javascript:dungeon(0,84579674);
j
javascript:dungeon(0,84579672);
j
javascript:dungeon(0,84579672);
j
javascript:dungeon(0,84579662);
j
javascript:dungeon(0,84579662);
j
its one big string output i think
print(list)
javascript:dungeon(0,84579684);
javascript:dungeon(0,84579684);
javascript:dungeon(0,84579674);
javascript:dungeon(0,84579674);
javascript:dungeon(0,84579672);
javascript:dungeon(0,84579672);
javascript:dungeon(0,84579662);
javascript:dungeon(0,84579662);
I want to be able to print(list[3]) and have javascript:dungeon(0,84579674); come up not "a" come up