Oliver Dewar
Board Regular
- Joined
- Apr 17, 2011
- Messages
- 201
Hi All.
For an excel app I'm building I need to (effectively) open a url in internet explorer, select all, and paste onto a sheet... or VBA equivalent. However, I'm not after the source code... I'm after the text that the website visitor would see in their browser. If images etc end up coming as well that's fine, I'll strip them out after.
I have the code to navigate to the page and that's working fine.
I can't find a way to copy the text on a web page as the browser displays it and then paste that onto a sheet. I've found many ways to grab the source code... but that's not what I need in this specific instance.
Can anyone help?
For the record, I can easily paste the html using the .document.body.innerHTML method. So I tried copying the source HTML and pasting as unicode text but sometimes it still comes across as HTML.
I tried sendkeys select all and copy then paste... but it didn't seem to work at all. It just doesn't seem to get onto the clipboard.
It doesn't matter if the text ends up in random columns and rows when it pastes as I have a macro to handle that... I just need a helping hand to get the rendered version of the url text as oppose to the source html. Alternatively, I guess a way to paste the source code, or handle the source code so that you end up with the final, readable text only would work too.
(I hope that makes sense... just swear at me and call me names if not and I'll rephrase).
Thanks everyone.
For an excel app I'm building I need to (effectively) open a url in internet explorer, select all, and paste onto a sheet... or VBA equivalent. However, I'm not after the source code... I'm after the text that the website visitor would see in their browser. If images etc end up coming as well that's fine, I'll strip them out after.
I have the code to navigate to the page and that's working fine.
I can't find a way to copy the text on a web page as the browser displays it and then paste that onto a sheet. I've found many ways to grab the source code... but that's not what I need in this specific instance.
Can anyone help?
For the record, I can easily paste the html using the .document.body.innerHTML method. So I tried copying the source HTML and pasting as unicode text but sometimes it still comes across as HTML.
I tried sendkeys select all and copy then paste... but it didn't seem to work at all. It just doesn't seem to get onto the clipboard.
It doesn't matter if the text ends up in random columns and rows when it pastes as I have a macro to handle that... I just need a helping hand to get the rendered version of the url text as oppose to the source html. Alternatively, I guess a way to paste the source code, or handle the source code so that you end up with the final, readable text only would work too.
(I hope that makes sense... just swear at me and call me names if not and I'll rephrase).
Thanks everyone.