title: Selenium - writing values to a .txt file
body: <p>I am attempting to pull some values from a webpage, with the intention of writing them into a .txt file for manual validation. I have looked around the web and cannot find the way to achieve this in my scenario. I will be writing the code in java if possible.</p>
  
  <p>I have the following html code available for the element:</p>
  
  <pre><code>&lt;td class="value" data-bind="text: 
  $data.value"&gt;Windows Server 2012 R2 Standard 64-bit&lt;/td&gt;
  </code></pre>
  
  <p>And the xpath for the element is:</p>
  
  <pre><code>html/body/div[4]/div/div[4]/div[2]/div[4]/div/div[1]/div[1]/table[1]/tbody/tr[2]/td[2]
  </code></pre>
  
  <p>Is anyone able to help me create a sample piece of code that will;</p>
  
  <p>a) Pick up the value and write it into a text file. Preferably with a prefix of 'Operating system'.
  <br>b) Save the file with a unique ID, My thought is to suffix the filename with a datetime stamp.
  <br>c) I will have multiple elements to read from the webpage and then write to the text file, around 8 or so, is there any consideration I need to be aware of for writing multiple values to a .txt file and format them neatly? </p>
  
  <p>Hopefully I have included everything I need to here, if not just ask!</p>
  
  <p>Many thanks in advance. KG</p>