Skip to content

Instantly share code, notes, and snippets.

@anjesh
Last active May 22, 2017 02:52
Show Gist options
  • Save anjesh/7f8b2758de1bf75f3c21 to your computer and use it in GitHub Desktop.
Save anjesh/7f8b2758de1bf75f3c21 to your computer and use it in GitHub Desktop.
Extract the faqs text from the site by running the code in the web console
faqs=document.querySelectorAll('.rule')
for(var i=0;i<faqs.length;i++) {
var faq = faqs[i];
var divs = faq.getElementsByTagName('div');
console.log(divs[0].outerText.trim())
console.log("==")
console.log(divs[3].outerText.trim())
console.log("--------------------------------------")
}
This is the content from the html, from which the faqs are extracted..
<div class="rule">
<div class="label_wrapper">
<div class="collapse-toggle"></div>
<div class="label neue f18 c2">
Can I submit more than one idea for the same category? </div>
</div>
<div class="text">
<p>You can submit only one idea in a category.&nbsp;</p> </div>
</div>
<div class="rule">
<div class="label_wrapper">
<div class="collapse-toggle"></div>
<div class="label neue f18 c2">
Can I submit idea for two or more categories? </div>
</div>
<div class="text">
<p>You may submit idea for different categories through separate registrations. If more than one of your ideas belonging to different categories get selected during the initial screening, you need to select one among them to proceed with the next phase (of idea refinement and development). The whole concept is to enable individual teams to focus on idea that they think is the best.&nbsp;</p> </div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment