Skip to content

Commit c91b74b

Browse files
committed
Fix for extracting question
In the DOM, there were multiple nodes with the .clue_text class. The first contains the question, the second contains the answer. If we select only the first item, we get the correct contents in the var_question variable!
1 parent 526c396 commit c91b74b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/tasks/get_latest.rake

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@
6767

6868
#=========== Set Answer =============
6969
answermatch = /ponse">(.*)<\/e/.match(answerDiv.to_html)
70-
71-
var_answer = answermatch.captures[0].to_s
72-
73-
#puts var_answer
74-
var_question = q.css('.clue_text').text()
70+
var_answer = answermatch.captures[0].to_s
71+
var_question = q.css('.clue_text').first.text()
7572
index = q.xpath('count(preceding-sibling::*)').to_i
7673
var_category = categoryArr[index]
7774
var_value = q.css('.clue_value').text[/[0-9\.]+/]

0 commit comments

Comments
 (0)