Note that there are some explanatory texts on larger screens.

plurals
  1. POIn Java code, how can I extract text of a random html page?
    text
    copied!<p>I solved this way:</p> <pre><code>String url = ("http://www.repubblica.it/economia/finanza/2011/10/27/news/la_fine_dell_incertezza_solleva_le_azioni_bancarie_in_borsa_alle_italiane_mancano_15_miliardi_di_capitale_met_di_unicredit-23967707/"); Document doc = Jsoup.parse(new URL(url), 2000); Elements body = doc.select("body"); String s=body.text(); System.out.println(s); </code></pre> <p>I still have another problem. I just want the main text without a title. Who can help me?</p> <hr> <p>I need an algorithm that extracts the text from websites. I want this text is clean from the tags, classes, etc. and I want that this algorithm can be applied to any web page.</p> <p>For example for <a href="http://www.repubblica.it/economia/finanza/2011/10/27/news/la_fine_dell_incertezza_solleva_le_azioni_bancarie_in_borsa_alle_italiane_mancano_15_miliardi_di_capitale_met_di_unicredit-23967707/" rel="nofollow">this page</a></p> <p>I need the main text:</p> <blockquote> <p>MILANO - Il tanto atteso responso sui fabbisogni di patrimonio delle maggiori banche europee è arrivato. L'Eba (l'Autorità di controllo bancaria europea) ha stabilito la necessità, entro giugno 2012, di ricapitalizzare per ben 106,5 miliardi di euro per i 30 gruppi europei più importanti. Sui 70 gruppi considerati, invece, il deficit patrimoniale è di 160 miliard...............</p> </blockquote> <p>For <a href="http://www.repubblica.it/economia/finanza/2011/10/27/news/chrysler_spinge_gli_utili_del_lingotto_fiat_contro_consob_sulla_lettera-23995026/" rel="nofollow">this page</a></p> <p>I need the main text:</p> <blockquote> <p>TORINO - Effetto Chrysler sui conti Fiat. Il Lingotto archivia il terzo trimestre con utili in crescita a 17,6 miliardi (8,4 nello stesso trimestre 2010). Più che triplicato l’utile della gestione ordinaria che passa da 256 a 851 milioni. Due terzi arrivano da Detroit che................</p> </blockquote> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload