I am trying to retrieve Amazon product’s details in HTML format. I have always used the same HTML retrieving code many times, and it has always worked. But for amazon’s product page, it doesn’t work. The result text is garbled and I cannot parse it.
I tried both MessageBox and Write Text File to see the result, but both don’t work.
Here is the code I have:
client: (of System.Net.WebClient)
result : (of String) - this should store the result HTML retrieved from website
Assign activity: client = New WebClient()
Assign activity: client.Encoding = System.Text.Encoding.UTF8
Assign activity: result = client.DownloadString(/* I entered a URL to an Amazon product page */)
MessageBox activity: result //This shows the below result.
Write Text File activity: //I set a path with “result” as the input, and I get the below result.
I don’t know why it is doing this. All I want is just HTML text from the URL.
Plus, I normally don’t even have to use the second Assign activity (where I am setting the encoding to UTF8). I included this because it was not working without it, and some famous coding forum people said add this UTF8 setting to fix the garbled text. But in my case, it didn’t fix it.
I am at my wits end. Can anyone help me?