How do you parse a web page and extract all the href links?

后端 未结 7 2040
情话喂你
情话喂你 2021-01-01 19:18

I want to parse a web page in Groovy and extract all of the href links and the associated text with it.

If the page contained these links:



        
7条回答
  •  花落未央
    2020-11-21 01:18

    It seems that the good-old ENVIRON awk built-in hash is not mentioned at all. An example of its usage:

    $ X=Solaris awk 'BEGIN{print ENVIRON["X"], ENVIRON["TERM"]}'
    Solaris rxvt
    

提交回复
热议问题