Nokogiri, open-uri, and Unicode Characters

前端 未结 8 2036
故里飘歌
故里飘歌 2020-11-30 01:56

I\'m using Nokogiri and open-uri to grab the contents of the title tag on a webpage, but am having trouble with accented characters. What\'s the best way to deal with these

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 02:44

    Tip: you could also use the Scrapifier gem to get metadata, as the page title, from URIs in a very simple way. The data are all encoded in UTF-8.

    Check it out: https://github.com/tiagopog/scrapifier

    Hope it's useful for you.

提交回复
热议问题