r/programmingrequests • u/KatayHan • Nov 08 '19
Extracting and listing links from a text file
Hello there! This one is easy.
I have a text file(actually html but, yeah). It has html codes and among them some useful link I have to collect and store. There are about 160 so I don't wanna find and copy each link manually.
Format is: <a class="entry-date permalink" href="https://blablablab.com/smthn/11111111">
I need those links as a list. Links are almost all the same. Domain consists of 10 letters. Ends with com. After "/", there are 5 other letters. Then at last part there are 8 digit numbers.So it just needs to find the part where it says
<a class="entry-date permalink" href="
and copy 37 characters after that. Then, list them in a text file.Result will be like this:
https://i.imgur.com/jyp8UNi.png
Listing with numbers like "1-, 2-, 3-" is not needed but I wouldn't say no.
Thanks in advance.
edit: at 08:23:00 EST> fixed the formatedit2: at 08:32:00 EST> Fixed some other stuff
2
u/djandDK Nov 11 '19
Did somebody finish this for you?
1
u/THEAVS Nov 08 '19
Post the text file
1
u/GSxHidden Nov 08 '19 edited Nov 08 '19
https://pastebin.com/hA685qGx