wikihow 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/lib/wikihow/scraper.rb +5 -1
- data/lib/wikihow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 774a464dc8a9b350e69b0f494c4336d7338c3b1579834ed1f998ff418b37da36
|
|
4
|
+
data.tar.gz: 60f803ea92cf5827a9a12e398efbbe34004a2e4bf540ad44858b6963f90a4ca9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 496aa3da5b3fa5dab5c0ec153f1f16267c8850d026a211e06e1ea57c7fb561063affbb52b3fad5486105a31542f5fb6fa254f52fb4de588479766bfbc92b3dfe
|
|
7
|
+
data.tar.gz: 4f4edeaf6f8baf2b21e4fc098ae1bfd79d6457361020099c62f98d245d38d616009d037114f9a760b77418def13814f1bbaf21fa30f11fd2de63c4781784ffef
|
data/lib/wikihow/scraper.rb
CHANGED
|
@@ -31,7 +31,7 @@ class Wikihow::Scraper
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
sections_array.each.with_index do |section, i|
|
|
34
|
-
doc.search(".
|
|
34
|
+
doc.search(".steps")[i].search(".step").each do |section_li|
|
|
35
35
|
step_description = [section_li.search(".whb").text.strip + " " + section_li.search("> text()").text.strip]
|
|
36
36
|
section_li.search("> ul > li").each do |step_li|
|
|
37
37
|
bullet_point = [step_li.search("> text(), a").text.strip]
|
|
@@ -41,6 +41,10 @@ class Wikihow::Scraper
|
|
|
41
41
|
end
|
|
42
42
|
section[:section_steps] << step_description
|
|
43
43
|
end
|
|
44
|
+
|
|
45
|
+
if doc.search(".steps")[i].search(".step").empty?
|
|
46
|
+
section[:section_steps] << ["There is no text description for this section"]
|
|
47
|
+
end
|
|
44
48
|
end
|
|
45
49
|
sections_array
|
|
46
50
|
end
|
data/lib/wikihow/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wikihow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "'Jared Grove'"
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|