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.
I have the following html code available for the element:
<td class="value" data-bind="text:
$data.value">Windows Server 2012 R2 Standard 64-bit</td>
And the xpath for the element is:
html/body/div[4]/div/div[4]/div[2]/div[4]/div/div[1]/div[1]/table[1]/tbody/tr[2]/td[2]
Is anyone able to help me create a sample piece of code that will;
a) Pick up the value and write it into a text file. Preferably with a prefix of 'Operating system'.
b) Save the file with a unique ID, My thought is to suffix the filename with a datetime stamp.
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?
Hopefully I have included everything I need to here, if not just ask!
Many thanks in advance. KG