I found myself in a situation where I wanted to examine the layout of the mobile version of a particular website. I tend to use Ruby's OpenURI
module and the Nokogiri
gem for my webscraping needs, and it turns out it's really easy to get a mobile version of the site with a bit more effort:
require 'open-uri'
require 'nokogiri'
# let's look at my GitHub profile as an example
url = 'https://github.com/O-I'
# this opens the URL and parses it as XML