vrCommander
10-18-2019, 04:04 AM
Hi everybody
I'm trying to find a way to copy data from a websites source code and paste it into excel.
The data looks like this:
<p>
<span class="highlight">Mitarbeiter:</span> 120 in Deutschland<br/>
<span style="display: "><span class="highlight">Umsatzklasse:</span> 10 - 50 Mio. Euro<br/></span>
<span style="display: none"><span class="highlight">Filialen:</span> <br/></span>
<span style="display: inline"><span class="highlight">Gegründet:</span> 1925</span>
</p
The value I'm looking for here would be "10 - 50 Mio. Euro".
This is the code I've written so far:
Sub Sample() Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.Navigate "https://www.wer-zu-wem.de/firma/steinel-normalien.html"
Do While .Busy And .readyState <> 4: DoEvents: Loop
Application.Wait Now + TimeValue("0:00:06")
Sheets("Dummy").Range("A1").Value = .document.body.outerHTML
.Quit
End With
End Sub
My approach here was to first copy the entire HTML source code to a spreadsheet and then continue with the InStr function.
However the solution above just gives me an excerpt from the full source code, which does not contain the data I'm looking for.
Does anyone know what exactly I'm doing wrong here?
Is there maybe a better approach, maybe to get the data I'm looking for directly from the website without the step inbetween?
Thank you guys in advance for any interest in my problem:hi::hi:
I'm trying to find a way to copy data from a websites source code and paste it into excel.
The data looks like this:
<p>
<span class="highlight">Mitarbeiter:</span> 120 in Deutschland<br/>
<span style="display: "><span class="highlight">Umsatzklasse:</span> 10 - 50 Mio. Euro<br/></span>
<span style="display: none"><span class="highlight">Filialen:</span> <br/></span>
<span style="display: inline"><span class="highlight">Gegründet:</span> 1925</span>
</p
The value I'm looking for here would be "10 - 50 Mio. Euro".
This is the code I've written so far:
Sub Sample() Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.Navigate "https://www.wer-zu-wem.de/firma/steinel-normalien.html"
Do While .Busy And .readyState <> 4: DoEvents: Loop
Application.Wait Now + TimeValue("0:00:06")
Sheets("Dummy").Range("A1").Value = .document.body.outerHTML
.Quit
End With
End Sub
My approach here was to first copy the entire HTML source code to a spreadsheet and then continue with the InStr function.
However the solution above just gives me an excerpt from the full source code, which does not contain the data I'm looking for.
Does anyone know what exactly I'm doing wrong here?
Is there maybe a better approach, maybe to get the data I'm looking for directly from the website without the step inbetween?
Thank you guys in advance for any interest in my problem:hi::hi: