I can retrieve the contents of a webpage into a variable like:
x = objIE.Document.body.outerHTML
But during development (data parse), I don’t want to keep pulling up a live site and instead just want to store some sample html in a format that can be placed in a variable. The issue is that trying to directly place a raw html sample into a variable creates errors and would require going through and escaping quotes etc. What’s an easy way to put place a large block of sample html in a variable?
You could read the html into a string variable using IO.StreamReader
then write it back out using IO.StreamWriter
I have never had issues with this method with escape characters, etc. I pull it in, then I can look at the code, make changes, etc. Works like a charm.