L
Legacy 185509
Guest
Hi,
I found this code online
but I have problem, I just do not want to pull source code.
I want to pull source code by changing setting User Agent.
Is there a way to get source code by changing User Agent to like iPhone or iPad via VBA?
Thanks
I found this code online
but I have problem, I just do not want to pull source code.
I want to pull source code by changing setting User Agent.
Is there a way to get source code by changing User Agent to like iPhone or iPad via VBA?
Thanks
Code:
[FONT=Arial]Sub Tester() [/FONT]
[FONT=Arial] Range("B2").Value = GetSource("[/FONT][URL="http://www.google.com/"]http://www.google.<wbr>com[/URL][FONT=Arial]") [/FONT]
[FONT=Arial]End Sub [/FONT]
[FONT=Arial]Function GetSource(sURL As String) As String [/FONT]
[FONT=Arial]Dim oXHTTP As Object [/FONT]
[FONT=Arial] Set oXHTTP = CreateObject("MSXML2.XMLHTTP") [/FONT]
[FONT=Arial] oXHTTP.Open "GET", sURL, False [/FONT]
[FONT=Arial] oXHTTP.send [/FONT]
[FONT=Arial] GetSource = oXHTTP.responsetext [/FONT]
[FONT=Arial] Set oXHTTP = Nothing [/FONT]
[FONT=Arial]End Function[/FONT]