book_finder_api 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/book_finder_api.rb +15 -2
- data/lib/book_finder_api/version.rb +1 -1
- metadata +1 -1
data/lib/book_finder_api.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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 ==""
|