rubycss-selectorsnokogiri

Nokogiri will not print, nothing returned from page.css


I wrote this script on an ubuntu machine, have recently just started using a chromebook on the beta channel and tried to use the same script with the same html file however nokogiri just returns nothing.

I've tried: Using the same version of Ruby (2.3.1) as originally used (on the Linux machine). Reinstalling Nokogiri after changing over to 2.3.1

require "nokogiri"

page = Nokogiri::HTML(open("prods.html"))
puts page.class #Nokogiri::HTML::Document

d = page.css("//div/[@class='ember-view']/div[@class='well']/h3/a")
lines = d.map(&:text).join("\n")
puts lines

This just lists products available on a rails site from a local html file. When using it on the Chromebook it will return the "page.class" but nothing is returned from "page.css" and when checking with pry "d" is empty.


Solution

  • Reinstalled ruby and re-cloned my repo