Alright,
I got following Code working:
import re
with open('html.txt') as f:
urls = f.read()
links = re.findall('"((http)s?://.*?)"', urls)
for url in links:
print(url[0].replace("#038;", "")) #Replace is for making invalid URL in a working one
HTML Textfile sample:
<td class="download-file" data-title="Download">
<a href="https://URL.com/?download_file=259&order=wc_order_xBxDxBxD&emailtestmail%40gmail.com&key=1234-1234-1234-1234-12345678" class="woocommerce-MyAccount-downloads-file button alt">
INSTRUCTION</a>
</td>
Problem:
There are couple of those Links in the HTML.txt File i created.
I also have a List of strings that match the URL Text, example: [Instruction, File2, File3, etc...]
Now I would like to match the strings in the List with the matching URL in my .txt File.
Basicly I want to create a Second List, that has the URL's of the matching Strings
However its not important that I have a specific order in the List, I just want to make sure each String in my List [Instruction, File2, File3, etc...] finds his matching URL from the Textfile.
Really struggled alot and cant find a solution, so I really appreciate your help on this matter.