-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
  • 19,677
  • 20
  • 102
  • 125

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,686
  • 2
  • 11
  • 18