Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getHTTP with (Excel) VBA?

I'm searching for a query for an Excel VBA macro to get a web page's HTML source code as a string.

I've found some source with getHTTPrequest but I can't register .net framework system.dll or link it.

Thanks!

like image 390
seansilver Avatar asked May 03 '09 17:05

seansilver


People also ask

How do you web scrape in Excel VBA?

Step 1) Open an Excel-based Macro and access the developer option of excel. Step 2) Select Visual Basic option under Developer ribbon. Step 3) Insert a new module. Step 5) Access the reference option under the tool tab and reference Microsoft HTML Object Library and Microsoft internet control.


1 Answers

Close enough: How can I send an HTTP POST request to a server from Excel using VBA? — It's even for Excel ;-)

Just use a GET request instead:

objHTTP.Open "GET", URL, False

MSDN: Using the WinHttpRequest COM Object - Retrieving Data Using Visual Basic

like image 193
Tomalak Avatar answered Oct 06 '22 00:10

Tomalak