Advanced VBA Code

uiqbal92

New Member
Joined
Jan 25, 2018
Messages
4
Hi,


I have an Excel sheet with around 800 search queries for instance "Therapy for Fever" and "Therapy for Pneumonia". What I've already done is extract URLs of the top 5 Google searches for these respective search queries. Now, what I want to be able to do is use these URLs and technically extract the description that appears in the Google Search for these queries.


If this is not possible, perhaps what would help is that through VBA, each of the URL automatically opens in Chrome, stays open for roughly 5 seconds so that I can have a quick look, close, open the next URL, and continue the loop.


I would really appreciate your help in this regard!


Thanks,
Umar
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi, I would suggest doing something like this using internet explorer:
Sub time_sheet_filling()


Dim IE As Object
Dim doc As Object
Dim objElement As Object
Dim objCollection As Object
Dim html As MSHTML.HTMLDocument
Dim URL As String
Dim ClassNameVar as string

Dim i As Integer

Set IE = CreateObject("<wbr>InternetExplorer.Application")

IE.Visible = True
URL=
ClassNameVar=


IE.navigate URL

Do While IE.Busy

Application.Wait DateAdd("s", 1, Now)

Loop


Set html = IE.document

'do parsing of html code here using getelementsby...
 
Upvote 0
Hi,

Thank you for the swift response!
Is this for fetching the description or for opening the URLs?

Since I'm new to VBA, could you please confirm whether I just need to insert this in a new module and run it?

Thanks,
Umar
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top