Answer the question
In order to leave comments, you need to log in
How to remove a link from the original using nokogiri?
I parse the site using nokogiri in ruby.
Everything is OK, only I need to remove all site.ru from the original from the source.
How to do it?
require 'open-uri'
require 'nokogiri'
require 'json'
url = 'http://site.ru/'
html = open(url)
doc = Nokogiri::HTML(html)
detail=doc.css('.content').inner_html
@show=detail
Answer the question
In order to leave comments, you need to log in
The very same question and decided:
Maybe someone will come in handy:
@show=detail.sub(" site.ru ", "")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question