Skip to content

Commit c72ccfe

Browse files
author
Oliver Denman
committed
Remove piref info from MembersPage urls
URLs stripped of 'piref' info point to pages that list the members in duplicate. Calling .uniq ensures we get each URL only once.
1 parent 3cf9b50 commit c72ccfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/members_page.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# frozen_string_literal: true
22
require 'scraped'
3+
require_relative 'remove_session_from_url_decorator'
34

45
class MembersPage < Scraped::HTML
56
decorator Scraped::Response::Decorator::CleanUrls
7+
decorator RemoveSessionFromUrlDecorator
68

79
field :member_urls do
8-
noko.css('div#RESULTADOS_DIPUTADOS div.listado_1 ul li a/@href').map(&:text)
10+
noko.css('div#RESULTADOS_DIPUTADOS div.listado_1 ul li a/@href').map(&:text).uniq
911
end
1012

1113
field :next_page_url do

0 commit comments

Comments
 (0)