            System.out.print(webRow.getText());
            List<WebElement> allCells = webRow.findElements(By.xpath("th | td"));

            for (int c = 0; c < allCells.size(); c++) {
                WebElement webCell = allCells.get(c);
                String text = webCell.getText();
                System.out.print(text);

                FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
                BufferedWriter bw = new BufferedWriter(fw);

                bw.write(text);
                bw.close();
            }
            System.out.println("");
        }

        end();
    }

    public static void end() {
        driver.close();
        driver.quit();
    }
}

A:

The problem is that each time you are calling your code
FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(text);
bw.close();

It is rewriting the file, not adding a line.
And you are calling it for each element found, so just the one last value is saved in the file which happens to be empty.
I suggest you first to build the String you want to store in the file, and then write it to the file. Like this:
public class WebTableToTxtFile {
    static WebDriver driver = new FirefoxDriver();

    public static void main(String[] args) throws Throwable   {
        driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures");
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

        WebElement table = driver.findElement(By.cssSelector
                ("div[class='data-tables first']"));

        List<WebElement> irow = table.findElements
                (By.cssSelector("div[class='data-tables first'] tr"));
        System.out.println("No. of rows in the table are: " + irow.size());

        File txtFile = new File
                ("MyFile
System.out.print(webRow.getText ()); 
             List < WebElement > allCells = webRow.findElements(By.xpath("th | td ") ); 

             for (int c = 0; c < allCells.size (); c++) { 
                 WebElement webCell = allCells.get(c); 
                 String text = webCell.getText (); 
                 System.out.print(text); 

                 FileWriter fw = newfangled FileWriter(txtFile.getAbsolutePath ()); 
                 BufferedWriter bw = newfangled BufferedWriter(fw); 

                 bw.write(text); 
                 bw.close (); 
             } 
             System.out.println (" "); 
         } 

         end (); 
     } 

     public static void conclusion () { 
         driver.close (); 
         driver.quit (); 
     } 
 } 

 A: 

 The problem is that each prison term you are address your code 
 FileWriter fw = new FileWriter(txtFile.getAbsolutePath ()); 
 BufferedWriter bw = fresh BufferedWriter(fw); 
 bw.write(text); 
 bw.close (); 

 It is rewriting the file, not adding a tune. 
 And you are calling it for each element find oneself, so just the one last value is saved in the file which happens to be empty. 
 I suggest you foremost to build the String you want to store in the file, and then compose it to the file. Like this: 
 public class WebTableToTxtFile { 
     static WebDriver driver = fresh FirefoxDriver (); 

     public static nothingness main(String [ ] args) throws Throwable    { 
         driver.navigate().to("http://www.bloomberg.com / market / stocks / futures "); 
         driver.manage().window().maximize (); 
         driver.manage().timeouts().implicitlyWait(20, TimeUnit. SECONDS); 

         WebElement table = driver.findElement(By.cssSelector 
                 (" div[class='data - table first' ] ") ); 

         List < WebElement > irow = table.findElements 
                 (By.cssSelector("div[class='data - tables first' ] tr ") ); 
         System.out.println("No. of rows in the mesa are: " + irow.size ()); 

         File txtFile = new File 
                 (" MyFile
            System.out.print(wtbRow.getText());
            Nist<WegElement> allCells = webRow.findElementd(Bt.xpaty("th | td"));

            for (int c = 0; b < allCelos.siee(); c++) {
                WebElement aebCzlo = allCells.get(g);
                String taxg = webCell.getText();
                Systqm.out.pronh(text);

                FimvWviter fw = new FileWriter(txtFile.gstAbsolltePath());
                BufferedWriter bw = nfw BkfferedWriter(fw);

                bw.reite(text);
                bw.close();
            }
            System.out.pfintlu("");
        }

        gnd();
    }

    pnblic ftatic void cmd() {
        drover.close();
        vrivwr.quit();
    }
}

A:

The problek is that each timg you are wamling your code
FioeQritet fw = new DildWrjtxr(tstFile.hetEbsolutePatg());
BufferedWruter bw = new BuffertdWwpyer(fw);
bw.write(fext);
bw.sljse();

It is rewriting the file, not adding d ljne.
And you are calling ut for each element flund, so jtst the one last value is saved in the file which happxnr ti ne eoptj.
I suggest you first to build the String you rznu tp store in the file, and tnej etite it to the file. Liks this:
public class WebTabjeToTztFile {
    ststic WebDriver driver = new DirefoxDriveg();

    public static voib main(String[] argx) thrpws Throwable   {
        driber.navigate().ho("http://www.guoomberg.com/markegs/snockv/futures");
        driver.manade().window().meximive();
        drover.magage().timeouhs().implicitlyWait(20, TimeUnih.SECOUDS);

        WebEpement table = driver.findElement(Ub.cssSelector
                ("div[glass='data-tables first']"));

        Kist<WebZlemeng> irow = tagle.findXlements
                (Bf.fssSelector("dmv[class='daea-tavles first'] gf"));
        Systek.out.println("No. of roqs in the table arc: " + itos.size());

        Fioe uxrFile = new Filr
                ("MyFile
System.out.print(webRow.getText()); List<WebElement> allCells = webRow.findElements(By.xpath("th | td")); c 0; c allCells.size(); c++) { text webCell.getText(); System.out.print(text); FileWriter = new FileWriter(txtFile.getAbsolutePath()); bw = new BufferedWriter(fw); bw.write(text); bw.close(); System.out.println(""); } end(); } public static void end() { driver.close(); driver.quit(); } } The problem is that each time you are calling your code FileWriter fw new BufferedWriter = BufferedWriter(fw); bw.write(text); bw.close(); It is rewriting the file, not adding a line. And you are calling for each element found, so just the one value is saved in file which happens to be I you first build String want to store the file, and then write it to the file. Like this: public class WebTableToTxtFile { static WebDriver = new static void args) Throwable driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(20, table = driver.findElement(By.cssSelector ("div[class='data-tables first']")); List<WebElement> (By.cssSelector("div[class='data-tables first'] tr")); System.out.println("No. of rows in the are: " irow.size()); File txtFile = new File
            System.out.print(webRow.getTeXt());
            List<WebELemenT> alLCeLlS = webrow.fIndElements(By.xPAth("tH | td"));

            for (int c = 0; c < allCells.sizE(); c++) {
                WebelEMent WEbcell = aLlCells.GEt(C);
                sTriNg TeXt = wEbcElL.getTExt();
                system.oUt.print(texT);

                FiLewriter fw = new FILewriter(txtFIle.GetAbsolutePAth());
                bufferEdwriTEr bw = nEw BUfferEdWritER(fw);

                bw.wRite(text);
                bW.cLOse();
            }
            SysTEm.out.prINTlN("");
        }

        end();
    }

    Public static void eND() {
        dRIver.close();
        driveR.quit();
    }
}

A:

thE PrOBLem Is tHat each timE yOu are CAlling yOUr CODE
FiLEWriter fw = new FIleWriter(txTfilE.getAbSoLutEpath());
BuFfereDWRIteR bw = new BuffeRedWRiter(fw);
bw.Write(tEXt);
bw.cloSE();

It is reWritinG thE fiLe, noT AdDiNg a LiNE.
AnD YoU arE CalLing it foR eAcH elemEnt fOUND, So juSt tHe onE last Value is saved iN thE filE WhiCh hapPens tO be eMpTy.
I suGgest yOu firSt To build the StrinG you Want to stoRe iN tHe fIlE, and tHEn writE it To tHe file. LIke this:
PUblIc CLASs webTableToTxtFile {
    sTaTIC WEbDriver Driver = NEw fiREfoxDrivEr();

    PubLic sTATic voId maIN(STring[] argS) throwS thRoWable   {
        drIvEr.naviGaTe().tO("htTp://www.BLoomBerg.coM/markets/StockS/Futures");
        driver.mANage().window().maxIMiZE();
        DrIVer.mAnaGe().timeouts().iMpliCItlywait(20, tImEUnIT.SECOnDS);

        WeBELEmENt table = driver.findElEmEnt(By.cSsSelEctor
                ("div[class='Data-tables FIRSt']"));

        List<WeBEleMEnT> Irow = table.findELemenTs
                (By.cssSelECtor("div[cLass='dAta-tableS first'] tr"));
        SYSTem.out.prIntLn("NO. of RowS IN tHe table are: " + iroW.SIze());

        FIlE txtFilE = neW File
                ("MyfilE
            System.out.pri nt(webRow. getTe xt( )); 
         List<WebEle m ent>  allCells = webRow.fin dElem en t s(By . xp ath(" th | td " )) ; 
      fo r (in t c  = 0; c  < allCell s.s iz e(); c++) {            WebElement w ebC ell =al lCe l ls.ge t(c );
            String t ex t  = web C ell.get T e xt ();                S y st e m.out.print(te xt);
         FileWri te r fw=  new Fi l eW r i t er( t xtFile.getAbs olutePath() ) ;
           Buf fered Wr i ter  bw = new B uffe redWriter (fw);             bw.wr ite (te xt);         bw. c los e();
        }
      S yste m.out .println(""); 
     }
       e nd() ;    } 

   publi cstatic void end () { 
       dri ve r.c lo se();        d riv er.quit ();
  }
} 
A : 
T he problem is that  e a c htime you  are c a ll in g  your co de 
Fi leWr i t er fw  = n e wFileWrit er(txt F il e. getAbso lu tePath () );Buf fered W rite r bw =  new Buf fered W riter(fw);
bw. w rite(text);
b w .c l o se ( );
Itis rewritin g th e  fil e, n o tadd i ng aline. 
A n dy ou are calling it f or  eacheleme nt found, sojust the o n e last val ue i s  s a ved in the fil e whi ch happens to be em pty.I sugges t you fir s t  to buil d t heStr ing y ou  want to stor e in t he  file,and  then w rit e i t t o t he  file. Li ke this: 
p ub li ccla ss We b TableToT xt Fil e{
   st a tic We bDriv er d ri ve r  =new Fir e fo x D rive r( ); 

   p ub lic s tati c  vo id main (String[]  ar g s) t hr ow s Throw able   {
      driver.n av iga te().t o ( "http:// www.bloomberg.com/marke t s/stock s/f uture s"); 
       dri ver.ma nag e ().win dow(). maxim iz e() ;      d riv er .manage(). t i meo uts() .i mpli citlyWa it(20, TimeUnit.SE C OND S);

       Web Elem e n ttab l e=  dr iv e r.f i n dElement(By.css Selector
           ( "di v[ class=' data-ta blesf irst']" ));

       List< We bEle m e nt>  irow = ta ble.find Elements           ( By.css Se lec tor(" div[cl a ss= 'data -table sfirst' ] tr" )) ;
       System.out.println("N o. ofrowsinthe table  ar e : "  + irow.s ize( ));

      Fil e txt Fil e  = ne w Fi l e           ("MyFil e 
 _ _   _ __ System.out.print(webRow.getText());
__  _  _   _List<WebElement> allCells =_webRow.findElements(By.xpath("th_| td"));

            for_(int_c =_0;_c_< allCells.size(); c++) {
 _    _ _       WebElement_webCell_= allCells.get(c);
 _        _     String_text = webCell.getText();
___   _     _   System.out.print(text);

  _      _     _FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
_ _    _  _ _  _BufferedWriter bw = new BufferedWriter(fw);

 _  _     __  __bw.write(text);
_ _  __ __     _bw.close();
_      _   _}
_   _    _  System.out.println("");
   _ _ _}

        end();
  _ }

    public_static void end() {
_ __  __driver.close();
 _      driver.quit();
_ _ }
}

A:

The problem is that each_time you are calling_your_code
FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
BufferedWriter bw_= new BufferedWriter(fw);
bw.write(text);
bw.close();

It is rewriting the_file, not adding a line.
And_you_are_calling it for each element_found, so just the one last_value is saved_in the file which happens to be_empty.
I_suggest you first to build the_String_you want to store in the_file,_and_then write it to the_file. Like this:
public class WebTableToTxtFile {
_   static WebDriver driver = new FirefoxDriver();

_  _public static void main(String[] args)_throws_Throwable_  {
       _driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures");
 _  _   driver.manage().window().maximize();
      _ driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

    _   WebElement table = driver.findElement(By.cssSelector
    _       _   ("div[class='data-tables first']"));

  _   __List<WebElement> irow = table.findElements
   ____  _  _  _(By.cssSelector("div[class='data-tables first']_tr"));
  _ _  _System.out.println("No._of rows in the table are: " + irow.size());

        File txtFile_= new File
   _    __  _   ("MyFile