I looked through the documentation of the URI class in ruby but couldn't find a way to extract the anchor (HTML) from the instance. For example, in
我查看了ruby中URI类的文档,但找不到从实例中提取锚点(HTML)的方法。例如,在
http://example.com/index.php?q=something#anchor
I would like to get the anchor
text. Trivial solution is to manipulate the text with regular expressions but if there is some method for it, then it's much better.
我想得到锚文本。简单的解决方案是使用正则表达式操作文本,但如果有一些方法,那么它会好得多。