nokogiri

    -1熱度

    1回答

    代碼: doc = Nokogiri::HTML(html) showings = [] doc.css('.ok-product').each do |showing| showing_id = showing['data-cart-id'].to_i price = showing.at_css('.ok-product__price-main').text.gsub(

    0熱度

    1回答

    搜索在我的控制器下面的代碼不起作用: @date = (Date.today - 1.day).strftime('%d.%m.%Y').to_s doc = Nokogiri::HTML(open("http://www.moex.com/ru/derivatives/contractresults.aspx?code=Si-6.17")) row = doc.xpath('//td[con

    3熱度

    1回答

    我試圖在安裝ruby 2.4.1p111之後在Windows 8.1上安裝Rails,從'用Ruby啓動命令提示符(這就像命令提示符那樣安裝了紅寶石)'。 我使用命令gem install rails,並在暫停幾秒鐘後,問題的標題被引發爲錯誤。 我試過命令gem install nokogiri -v 1.7.1,它會引發同樣的錯誤。 如果我運行gem list,它根本沒有列出nokogiri。

    1熱度

    1回答

    考慮下面的XML特定類型的: <w:p> <w:pPr> <w:lang w:val="en-CA"/> </w:pPr> <w:ins> <w:t>sections</w:t> </w:ins> <w:pPr> <w:lang w:val="en-CA"/> </w:pPr> <w:r>

    0熱度

    1回答

    我有一個來自API的HTML,它是我想要清理和格式化的。 我試圖得到任何<strong>標籤是一個<p>標籤中的第一個元素,並將其更改爲是<p>標籤的父,和<p>標籤轉換爲<h4>。 例如: <p><strong>This is what I want to pull out to an h4 tag.</strong>Here's the rest of the paragraph.</p>

    1熱度

    1回答

    我最近添加了一個消毒sanitize gem,它似乎對nokogumbo gem有依賴性,我正在部署在Heroku上的一個站點。不幸的是,在安裝了sanitize後,我就開始收到關於Heroku的部署以下錯誤: /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:293:

    0熱度

    2回答

    檢索XML文檔中的谷歌命名空間中的數據我有這樣的谷歌購物飼料: <?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"> <channel> <item> <title>test</title> <g:id>1</g:id>

    0熱度

    1回答

    引入nokogiri這是我的軟件版本: 紅寶石:2.2.1 的Rails:4.2.0 Capistrano的:3.8.1 彪馬: 3.9.1 這是我Capfile: require "capistrano/setup" require "capistrano/deploy" require "capistrano/scm/git" install_plugin Capistrano::SCM

    0熱度

    1回答

    如何獲取屬性,我有這樣一個XML文件: <?xml version="1.0" encoding="UTF-8"?> <bulkCmConfigDataFile xmlns:es="EricssonSpecificAttributes.17.08.xsd" xmlns:un="utranNrm.xsd" xmlns:xn="genericNrm.xsd" xmlns:gn="geranNrm

    0熱度

    2回答

    我有一個需要大量XML數據並將其傳遞給Nokogiri的項目,最終將每個元素添加到散列輸出到YAML文件。 這是有效的,直到XML數據集包含重複鍵。 實施例的數據: <document> <form xmlns=""> <title> <main-title>Foo</main-title> </title> <homes>