nokogiri Questions
5
Solved
I am using nokogiri to generate svg pictures. I would like to add the correct xml preamble and svg DTD declaration to get something like:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE s...
4
Solved
Building a new Rails app and getting a problem with nokogiri. Said to try gem install nokogiri -v '1.6.8.1' which fails with output below. I tried deleting Gemfile.lock and using the Gemfile from a...
Linder asked 8/10, 2016 at 21:7
1
Solved
Nokogiri is the bane of my existence. It makes my rails new command fail for a different reason every time I create a new Rails app.
There’s a ton of Nokogiri troubleshooting on StackOverflow, but...
Tubulate asked 22/1, 2017 at 20:14
3
Solved
Perhaps this is nitpicky, but I have to ask.
I'm using Nokogiri to parse XML, remove certain tags, and write over the original file with the results. Using .remove leaves blank lines in the XML. ...
2
Solved
I just started using Nokogiri this morning and I'm wondering how to perform a simple task: I just need to search a webpage for a div like this:
<div id="verify" style="display:none"> site_ve...
Regenerate asked 22/7, 2012 at 16:40
30
Solved
I upgraded my OSX (Lion) to Mavericks and I can't install Nokogiri for my projects.
I already install XCode 5.0.1, Command Line Tools (using xcode-select --install), and already installed libxml2...
Joesphjoete asked 28/10, 2013 at 19:11
1
Solved
The content I'm scraping includes some blank elements. I either need to stop variables being set if there is no data (preferable) or just do some surgery afterwards and completely delete hashes con...
1
Solved
I have to clean up a Nokogiri::HTML::DocumentFragment document (remove comment nodes and text nodes which contain whitespace only). Here's an example:
html = "<p>paragraph</p><!-- c...
3
Solved
I am using Nokogiri to analyze some HTML, but, I don't know how get the raw HTML inside a node.
For example, given:
<tr class="tableX">
<td align="center">
<font size="2"><...
22
Solved
I recently upgrade to the 10.10 Yosemite beta, but I'm having trouble getting Nokogiri installed. I'm using RVM and Ruby 1.9.3. I've also followed the steps here and tried following the instruction...
1
Solved
(Update: This answer is written from the point of view of Nokogiri, but it's also useful if you're looking for the XPATH or CSS syntax for specific queries.)
I love Nokogiri -- it's a wonderful to...
2
Solved
I'm using Ruby, Selenium WebDriver and Nokogiri to retrieve data from webpages. Once the proper HTML is loaded, I print the contents of a certain class.
For example,
require "selenium-webdriver"
...
Cordate asked 10/9, 2016 at 5:10
2
Solved
I have a simple XML file, items.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<items>
<item>
<name>mouse</name>
<manufacturer>Logicteh</manufacturer>
...
2
Solved
I have this html markup:
<div class="item"><a href="www"></a></div>
and I'd like to get this:
<div><a></a></div>
How can I do it with Nokogir...
3
Solved
I'm trying to pull out the dc:title element using an xpath. I can pull out the metadata using the following code.
doc = <<END
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="...
2
Anyone seen this?
gem update nokogiri
Updating installed gems
Updating nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem ...
3
Solved
Is there a way I can accomplish the following using Nokogiri's xpath() ?
doc.xpath("//pod[@id=or('anid','anotherid')]")
5
Solved
Is it possible to convert HTML with Nokogiri to plain text? I also want to include <br /> tag.
For example, given this HTML:
<p>ala ma kota</p> <br /> <span>i kot to...
8
I am trying to setup rails env on my new ubuntu machine. But I am facing trouble while install nokogiri gem.. I have installed libxslt and libxml2 libs thourgh rvm pkg command as well as using apt-...
Perusal asked 26/7, 2012 at 6:17
2
I'm using Nokogiri to parse some XML that looks kind of like:
<item name="item one">
<other name="other name"/>
<third />
</item>
<item name="item two">
<other ...
3
Solved
I push a rails app to appfog, but got following error message:
/var/vcap.local/dea/apps/superb-0-dc92a2e492e46c40c06d2abc3ad59841/app/rubygems
ruby/1.9.1/gems/bundler-1.1.3/lib/bundler/resolver...
Damico asked 20/2, 2013 at 5:45
1
Solved
I'm trying to parse an HTML fragment that contains a custom HTML tag using Nokogiri.
Example:
string = "<div>hello</div>\n<custom-tag></custom-tag>"
I tried to load it i...
2
I'm trying to install Rails 4.2.0 on my computer, but I am having issues installing Nokogiri. I followed the steps in the first answer for "bundle install stopped at Nokogiri", but when I run brew ...
Syreetasyria asked 1/2, 2015 at 1:19
3
Solved
I'm trying to parse a table but I don't know how to save the data from it. I want to save the data in each row row to look like:
['Raw name 1', 2,094, 0,017, 0,098, 0,113, 0,452]
The sample tabl...
Oneself asked 14/1, 2016 at 4:9
4
Solved
Given:
require 'rubygems'
require 'nokogiri'
value = Nokogiri::HTML.parse(<<-HTML_END)
"<html>
<body>
<p id='para-1'>A</p>
<div class='block' id='X1'>
<h...
© 2022 - 2024 — McMap. All rights reserved.