nokogiri Questions

1

I'm scraping a site and I can't get the images, because they are loaded with background-image CSS. Is there a way to get these attributes with Nokogiri without having to use Phantom.js or Sentinel...
Apollo asked 29/1, 2015 at 16:44

1

What would be the best and most efficient way to to perform XSL transformation in Ruby? I have tried Nokogiri, but no matter what I tried it always results in: compilation error: element styleshee...
Illogic asked 21/12, 2010 at 11:12

3

Solved

The document I am parsing has the following two styles of td tags (among other instances of td tags): <td align="right" nowrap bgcolor="#A1C87A">...</td> <td align="right" nowrap&g...
Enphytotic asked 1/1, 2015 at 19:16

2

Solved

UPDATE: Fixed I found the answer in another thread. The workaround I used is to tell Nokogiri to use the system libraries instead: NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install ==== Trying to...
Blackthorn asked 25/7, 2013 at 16:17

1

Solved

I'm trying to get all the nodes from a HTML document using Nokogiri. I have this HTML: <html> <body> <h1>Header1</h1> <h2>Header22</h2> <ul> <li&g...
Mass asked 4/12, 2014 at 15:50

10

Solved

Trying to install Nokogiri I’m getting the following error Maxims-MacBook-Air:ScrapingTheApple maximveksler$ gem install nokogiri Fetching: nokogiri-1.6.2.1.gem (100%) Building native extensions. ...
Ameliorate asked 12/7, 2014 at 9:19

1

Solved

So if I have this piece of code <body> <div class="red"> <a href="http://www.example.com>Example</a> </div> </body> I know that I want to get an element w...
Sextodecimo asked 28/6, 2014 at 11:20

4

When I try to run a ruby on rails project I got an error: An error occurred while installing nokogiri (1.5.2), and bundle cannot continue. Make sure that 'gem install nokogiri -v 1.5.2 succeed be...
Lyingin asked 15/3, 2012 at 18:14

3

Nokogiri has a problem with translating to and from UTF-8 characters that turns out to come from libxml2, specifically version 2.7.6, which is the highest supported version on Ubuntu 10.04 LTS. The...
Sikes asked 22/12, 2011 at 2:52

2

Solved

I am having problems creating nodes and adding them to an XML file: <mainnode> <secnode> <data1></data2> <data2></data2> </secnode> </mainnode> ...
Furry asked 28/10, 2014 at 5:5

2

Solved

I am trying to load song names from an iTunes library export of a plist via Nokigiri: doc = Nokogiri::XML(open(file.path)) @songs = Array.new doc.xpath(<XPATH_HERE>).each do |n| @songs.pu...
Abrasive asked 17/10, 2014 at 7:12

2

xpath for selecting html tag ? <select> <option value="first option"> 1 </option> <option value="second option"> 2 </option> <option value="third option"> 3 &lt...
Weywadt asked 8/10, 2009 at 2:57

4

Solved

I've been trying to get Nokogiri installed on my computer (Mountain Lion) to use with rspec and capybara, but for the life of me, I can't get it to run properly. From what I can tell, the issue is...
Grantinaid asked 5/4, 2013 at 19:50

3

Solved

I'm scrapling an html page with nokogiri and i want to strip out all style attributes. How can I achieve this? (i'm not using rails so i can't use it's sanitize method and i don't want to use sanit...
Slacker asked 23/5, 2011 at 11:3

4

Solved

I may have taken one step too far beyond my knowledge. I installed Homebrew and after it continued to give me warnings about having MacPorts installed I uninstalled that. But now my rspec tests don...
Verjuice asked 19/4, 2011 at 9:14

4

Install fails showing: checking for iconv_open() in iconv.h... no checking for iconv_open() in -liconv... no checking for iconv_open() in -liconv... no checking for libiconv_open() in iconv.h... n...
Braid asked 1/5, 2014 at 2:26

2

I'm trying to use Nokogiri to convert some template files from one format to another. But it keeps adding tags. I'm trying to prevent it from adding Doctype and meta tags, but can't figure it out. ...
Grayson asked 23/9, 2014 at 15:19

5

Solved

I've tried to install Nokogiri 1.6.1 under Ruby and RVM but is failing with the following error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/lmo0/.rvm...
Orthochromatic asked 2/1, 2014 at 19:58

3

perhaps im doing it wrong, or there's another more efficient way. Here is my problem: I first, using nokogiri open an html document and use its css to traverse the document until i find the link w...
Electrotechnics asked 20/9, 2011 at 22:44

1

Solved

I searched for text nodes on a document fragment. This works, as the following snippet shows: doc = Nokogiri::HTML::DocumentFragment.parse("<p>foo</p>") doc.xpath('.//text()') => [...
Enhanced asked 10/9, 2014 at 7:2

2

How can I get the element at index 2. For example in following HTML I want to display the third element i.e a DIV: <HTMl> <DIV></DIV> <OL></OL> <DIV> </D...
Remonstrate asked 6/9, 2014 at 4:51

3

Solved

I'm trying to install the Nokogiri gem under an RVM managed Ruby 1.8.7 installation in OS X Leopard (10.5.8). I'm getting the following error: Building native extensions. This could take a while......
Synthetic asked 17/2, 2012 at 0:6

1

I was trying to convert a DTD file to a YAML file, and I've tried loading it both in libXML and Nokogiri, but it seems that a DTD file is not a valid XML file. I'm fine with using any third-party g...
Bloodstain asked 12/7, 2014 at 16:31

3

Solved

While parsing an indented XML, non-significant white space text nodes are created from the white spaces between a closing and an opening tag. For example, from the following XML: <note> &lt...
Schaller asked 14/1, 2014 at 13:37

1

Solved

I would like to parse my XML file. I need to count attributes and have their name and value... require 'nokogiri' f = File.open("file.xml") doc = Nokogiri::XML(f) f.close p doc.xpath("/a/@*").coun...
Immediacy asked 31/5, 2014 at 20:46

© 2022 - 2024 — McMap. All rights reserved.