This challenge needs to be solved in Python.
- You are given an
.txt
file.- example: sample_input.txt
- You are supposed to write a python program to get all the URLs from the file and convert them into anchor tags.
- example: sample_output.txt
For example,
will be replaced by
<a rel="noreferrer noopener" target="_blank" title="https://example.com" href="https://example.com" >https://example.com </a>
- rest of the content must be left EXACTLY as it was in the input file
- they should have the
rel
,target
,href
andtitle
properties as shown in the above example. - your solution should be a
.py
file with a functionanchor_that_url(input)
which takes the path of a.txt
file. - the function should create an
output.txt
file which has the output. - test your code for various different inputs.
- do proper error handling.