book_finder_api 0.0.11 → 0.0.12

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.
@@ -42,12 +42,17 @@ class BookFinder
42
42
  breadcrumb = page.search(".fk-lbreadbcrumb a")
43
43
  generals = ['Other General','Others Engineering']
44
44
 
45
+
45
46
  if breadcrumb.count >0
46
47
  result['college']=breadcrumb[4].search("span").text()
47
- result['stream']= breadcrumb[5].search("span").text()
48
+ if(breadcrumb[5])
49
+ result['stream']= breadcrumb[5].search("span").text()
50
+ end
48
51
  if generals.include? (result['college'])
49
52
  result['college']=breadcrumb[5].search("span").text()
50
- result['stream']= breadcrumb[6].search("span").text()
53
+ if(breadcrumb[6])
54
+ result['stream']= breadcrumb[6].search("span").text()
55
+ end
51
56
  end
52
57
  end
53
58
 
@@ -58,6 +63,14 @@ class BookFinder
58
63
  result["img_url"]=img_url.to_s
59
64
  end
60
65
 
66
+ if result["img_url"]==""
67
+ page.search("#mprodimg-id").each do |img_id|
68
+ img_tag=img_id.search("img")
69
+ img_url=img_tag.attribute("src")
70
+ result["img_url"]=img_url.to_s
71
+ end
72
+ end
73
+
61
74
  #storing the price
62
75
  price=page.search("#fk-mprod-list-id").text()
63
76
  if price ==""
@@ -1,3 +1,3 @@
1
1
  module BookFinderApi
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: book_finder_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: