title: Extract text from html file using java
body: <p>I am working on a text crawler and I need to extract a certain text from several sites. I have used jsoup html parser:</p>
  
  <pre><code>Document doc = Jsoup.connect("http://www.aljazeera.net/programs/behindthenews/2014/11/9/%D8%A3%D8%B3%D8%A8%D8%A7%D8%A8-%D9%88%D8%AF%D9%84%D8%A7%D9%84%D8%A7%D8%AA-%D8%A7%D8%B3%D8%AA%D9%85%D8%B1%D8%A7%D8%B1-%D8%A7%D9%84%D8%B5%D8%AF%D8%A7%D9%85-%D8%A8%D8%AC%D8%A7%D9%85%D8%B9%D8%A7%D8%AA-%D9%85%D8%B5%D8%B1").get();
  Elements ps = doc.select("p");
  String s = Jsoup.parse(ps.text()).text();
  PrintWriter out = new PrintWriter("newFile.txt", "UTF-8");
  out.write(s);
  out.close();
  </code></pre>
  
  <p>This algorithm gets me an unwanted text, the wanted text is under this tag <code>&lt;p dir="rtl"&gt;</code></p>
  
  <p>And when I change my selection to <code>Elements ps = doc.select("p dir=rtl");</code>, it returns a compilation error.</p>
  
  <p>Is there any way to make it just select this wanted tag?</p>