I want to extract the .zip filenames from given URl. Here is my code-
import re
print(re.findall(r'href=[\'"]?([^\'" >]+)','<a href="http://www.example.com/files/world_data1.zip"><b>World Data Part 1</b></a> <br/> <a href="http://www.example.com/files/world_data2.zip"><b>World Data Part 2</b></a>'))
For example:
Input -<a href="http://www.example.com/files/world_data1.zip"><b>World Data Part 1</b></a> <br/> <a href="http://www.example.com/files/world_data2.zip"><b>World Data Part 2</b></a>
Expected Output - world_data1.zip,world_data2.zip
.
I tried using .zip $ in various format but I get an empty list. Can anyone help me with this?