How to parse / load a stylesheet from HTML
I am loading part of the HTML page:
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('https://example.com/index.html'))
wiki = doc./('//*[@id="wiki"]/div[1]')
and I need the stylesheets to display them correctly. They are included in the header as follows:
<!DOCTYPE html>
<html lang="en" class="">
<head>
...
<link href="https://example.com/9f40a.css" media="all" rel="stylesheet" />
<link href="https://example.com/4e5fb.css" media="all" rel="stylesheet" />
...
</head>
...
and their naming can be changed. How to parse / load local copies of stylesheets?
+3
source to share