title: copy all text from a webpage and paste into a created text file with time stamp using vbscript
body: <p>I have been assigned a task of copying text from a webpage and pasting it on a textfile hourly. And that text file should have date and time. For example if I take the reading on 24th May 2018 at 9AM then the file name should be 24May09AM or 24-5-09. AM/PM isn't mandatory as 24 hour time format can be used. I know how to open the website using vbscript and also create a text file using the date and time part. I dont know how to get the text from website to copy. Also the way I take the reading is I log into the webapp url and modify the url to get the health reading. Example : the url is <a href="https://client/comp/acct/Userlogin" rel="nofollow noreferrer">https://client/comp/acct/Userlogin</a>. I enter the log in credentials and hit enter. After logging in the url becomes :
  <a href="https://client/comp/acct/Home" rel="nofollow noreferrer">https://client/comp/acct/Home</a>. Then I replace Home with Health and get the health reading of the app. So the url becomes : <a href="https://client/comp/acct/Health" rel="nofollow noreferrer">https://client/comp/acct/Health</a>  and this page has only text.</p>
  
  <p>I cant install Autoit or any other tools in office system.</p>
  
  <p>The 2 things I know are : one - how to create a text file using date and time </p>
  
  <pre><code>fnmt = Day(Now()) &amp; "_" &amp; Month(Now()) &amp; "_" &amp; Right(Hour(Now()),2)
  fpath = ("E:\Test_Health_Monitor\" &amp; fnmt &amp; ".txt")
  
  set objFSO = CreateObject("Scripting.FileSystemObject")
  
  set objFile = objFSO.CreateTextFile(fpath)
  </code></pre>
  
  <p>Two - how to open the app url from vbs file</p>
  
  <pre><code>set w=wscript.CreateObject("wscript.shell")
  w.run "iexplore.exe"
  wscript.sleep (1000)
  w.SendKeys "{F6}"
  w.SendKeys "https://client/comp/acct/Userlogin"
  w.SendKeys "{ENTER}"
  wscript.sleep (7500)
  rem w.SendKeys "(username)"
  rem w.SendKeys "{TAB}"
  rem wscript.sleep (1000)
  rem w.SendKeys "(password)"
  w.SendKeys "{ENTER}"
  </code></pre>
  
  <p>Now I dont know how to edit the url after logging in and then copy all the text to the created text file. Please help or guide to some pointers.</p>