Last active
May 22, 2017 02:52
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//extract links from http://instante.justice.md/ using console | |
panes = document.getElementsByClassName('pane-content') | |
for(var i=0;i<panes.length;i++) { | |
var links = panes[i].getElementsByTagName('a') | |
for(var j=0;j<links.length;j++) { | |
console.log(links[j].href); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. </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. </p> </div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment