I need to extract the data within double quotes from a string.
Input:
<a href="Networking-denial-of-service.aspx">Next Page →</a>
Output:
Networking-denial-of-service.aspx
Currently, I am using following method to do this and it is running fine.
atag = '<a href="Networking-denial-of-service.aspx">Next Page →</a>'
start = 0
end = 0
for i in range(len(atag)):
if atag[i] == '"' and start==0:
start = i
elif atag[i] == '"' and end==0:
end = i
nxtlink = atag[start+1:end]
So, my question is that is there any other efficient way to do this task.
Thankyou.