Class: BandcampDiscover::Scrapers::Album

Inherits:
Base
  • Object
show all
Defined in:
lib/bandcamp-discover/scrapers/album.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from BandcampDiscover::Scrapers::Base

Instance Method Details

#scrape(force: false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bandcamp-discover/scrapers/album.rb', line 7

def scrape(force: false)
  super do |page|
    page.goto(@url)

    title = page.query_selector("meta[name=title]")&.[](:content)

    # querying all tags in the bottom and returning their text node
    tags = page.query_selector_all("a.tag")
    tags.map!(&:inner_text)

    player = page.query_selector("meta[property='og:video']")&.[](:content)

    [@url, title, tags, player]
  end
end