-1

Here is a sample website url with a list of folders; I need to get these folder names stored using shell / bash script

enter image description here

Prashanth Sams
  • 16,250
  • 19
  • 96
  • 119

1 Answers1

4

With GNU grep:

curl <url> | grep -oP '<a href=".+?">\K.+?(?=<)'

Mac:

curl <url> | perl -nle 'print $& while m{<a href=".+?">\K.+?(?=<)}g'

It might need some tweaking for your specific site.

krisz
  • 2,208
  • 2
  • 8
  • 13