Hello,
I need some help from you.
I would like to insert the text of a website into Excel as if the website were saved as a txt file.
I found this macro on the web for this purpose:
Sub Copy()
Dim IEApp As Object
Dim IEDocument As Object
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = False
IEApp.Navigate "Link"
Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.Busy = False
Set IEDocument = IEApp.Document
Do: Loop Until IEDocument.ReadyState = "complete"
zeile = 1
For Each teil In Split(IEDocument.body.innertext, vbCrLf)
Tabelle1.Cells(zeile, 1).FormulaR1C1 = teil
zeile = zeile + 1
Next
IEApp.Quit
Set IEDocument = Nothing
Set IEApp = Nothing
End Sub
It works great and just as I imagined.
Now comes my request.
This macro only works with the Internet Explorer.
But I would like to use the Chrome browser for this.
I have already downloaded SeleniumBasic 2.0.9, installed the appropriate Chrome driver and established the interface to Excel.
With this test macro I started Chrome, sent a link and successfully closed it:
What do I have to change in the upper macro, so that not IE is addressed but Chrome?Sub Test()
Dim driver As New CromeDriver
driver.Get "Link"
driver.Quit
End Sub
Thanks
Bookmarks