Extract links from string optimization

前端 未结 7 1050
予麋鹿
予麋鹿 2021-01-03 05:21

I get data (HTML string) from website. I want to extract all links. I write function (it works), but it is so slow...

Can you help me to optimize it? What standard

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 05:33

    There's actually a class called NSDataDetector that will detect the link for you.

    You can find an example of it on NSHipster here: http://nshipster.com/nsdatadetector/

提交回复
热议问题