All Questions
3,271
questions
1
vote
1
answer
57
views
Fetch string only until specific word on ruby
I am building a scraper/parsing method, but the website I am using (https://www.bbcgoodfood.com/search?q=banana)to get the value from have many different informations using the same classes (they have ...
1
vote
1
answer
155
views
Nokogiri installation error and fails with mac os x 14 Sonova
I am trying to install an older version of nokogiri (1.6.8.1) on a x86 intel mac using sonova 14.4 with a ruby project of mine but i am experiencing a problem with either bundle install or gem install ...
2
votes
0
answers
338
views
Bundle install is failing with gem nokogiri error
I'm running my app on ubuntu, ruby 2.7.8 using rbenv
When I do bundle install I received error
An error occurred while installing nokogiri (1.6.8.1), and Bundler
cannot continue. Make sure that gem ...
0
votes
2
answers
2k
views
No versions of nokogiri compatible with my Ruby
I am installing a 2017 Rails project from GitHub. It is my understanding I need to first install Ruby and Rails before cloning the project. The project uses Ruby 2.4.1 and Rails version 5.0.1, so I am ...
0
votes
0
answers
44
views
migration to OGA from nokogiri
I have been using Nokogiri for many years without any problem, lately I have read that the oga gem (https://github.com/yorickpeterse/oga) consumes less resources and I would like to try it myself, but ...
0
votes
1
answer
86
views
Ruby Nokogiri::XML::SyntaxError Tag figure invalid, but tag appears to be free of errors
Ruby's Nokogiri keeps complaining about HTML that looks perfectly fine to me. Below's an example of the affected HTML and the full error message.
<div class="media">
<figure id=&...
0
votes
1
answer
46
views
Using Nokogiri to scrape element from a web page with ruby
Description
Have a web page which loading into Mechanize ruby gem. Problem is that I can see the HTML fragment in developer tools but not having any luck extracting the element and the associated ...
0
votes
1
answer
45
views
Having difficulty with CSS selector for multiple possibilities
I'm having difficulty getting a CSS selector to work with Nokogiri. I'm trying
to search for all <tr> nodes that are direct descendants of a
<table> or are direct descendants of a <...
0
votes
1
answer
126
views
Decoding Amazon Reports in CP932 with Ruby
Reports out of Amazon's SP-API are generally in UTF-8 except for the ones out of Japan, which are in CP932.
I cannot seem to figure out how to decode these into usable data.
Running Ruby 3.1.2 and ...
0
votes
2
answers
50
views
How to extract the word Default from this xml?
<XCUIElementTypeCell type="XCUIElementTypeCell" enabled="true" visible="true" x="0" y="165" width="320" height="40">
<...
1
vote
1
answer
98
views
How to see if one Nokogiri::XML::Node contains parts of another Nokogiri::XML::Node?
Using ruby Nokogiri I have a Nokogiri::XML::Node object (ConstituencyXMLNode inherits from Nokogiri::XML::Node) that is a tree object like such:
#(ConstituencyXMLNode:0xc3c8 {
name = "PP",
...
1
vote
2
answers
87
views
Trying to scrape an image using Nokogiri but it returns a link that I was not expecting
I'm doing a scraping exercise and trying to scrape the poster from a website using Nokogiri.
This is the link that I want to get:
https://a.ltrbxd.com/resized/film-poster/5/8/6/7/2/3/586723-glass-...
1
vote
0
answers
36
views
Joining text from parsing a complex table structure in ruby nokogiri
I have an HTML table and I want to get the text from some td's. Now sometime the text is in single td but sometimes its spread into multiple td's. How can I join the text in case if its spread in ...
0
votes
1
answer
75
views
How to merge 3 hashes?
I have been trying to get some information from a table into a hash so this is the code I have a HTML table like below, and Im extracting party_names and types and merging them in the single hash. Now ...
2
votes
1
answer
53
views
Parsing a non-XML document with Nokogiri when the node names are/contain integers
When I run:
#!/usr/bin/env ruby
require 'nokogiri'
xml = <<-EOXML
<pajamas>
<bananas>
<foo>bar</foo>
<bar>bar</bar>
<1>bar</1>
&...