olek-libcraigscrape 1.1.0.3 → 1.1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/listings.rb +2 -2
- metadata +1 -1
data/lib/listings.rb
CHANGED
@@ -72,7 +72,7 @@ class CraigScrape::Listings < CraigScrape::Scraper
|
|
72
72
|
if html.at_xpath(XPATH_PAGENAV_LINKS)
|
73
73
|
# Post 12/3
|
74
74
|
next_link = html.xpath(XPATH_PAGENAV_LINKS).find{|link| NEXT_PAGE_LINK.match link.content}
|
75
|
-
@next_page_href = next_link[:href]
|
75
|
+
@next_page_href = next_link[:href] if next_link
|
76
76
|
else
|
77
77
|
# Old style
|
78
78
|
cursor = html.at 'p:last-of-type'
|
@@ -111,7 +111,7 @@ class CraigScrape::Listings < CraigScrape::Scraper
|
|
111
111
|
|
112
112
|
# Returns a Listings object of the next_page_url on the current listings object
|
113
113
|
def next_page
|
114
|
-
CraigScrape::Listings.new next_page_url if next_page_url
|
114
|
+
CraigScrape::Listings.new URI.encode(next_page_url) if next_page_url
|
115
115
|
end
|
116
116
|
|
117
117
|
# Takes a paragraph element and returns a mostly-parsed Posting
|