hi everyone I'm going to teach you how
to do data scraping from different
websites using Microsoft Excel so we
will be writing VBA or you can say my
Excel macros to extract data from
websites so to learn this concept first
understand that scraping is illegal so
you do it at your own so let's open VB
editor by Alt + f11 and then go to tools
references and here you need to find the
two most important libraries that we are
going to use for data scraping from
website so if you scroll down here and
go to Microsoft so first one is
Microsoft HTML object library and second
one is Microsoft Internet controls so in
all our tutorials we are going to use
these two libraries and various
functions of these left so once you
import the libraries we go to this area
and then insert a module so this is a
space where we are going to write our
code so first of all create a sub
procedure whose name is test the syntax
is sub tests and then bracket and then
ends up now we need to work with a
browser and the document so first of all
we declare a variable whose name is ie
as Internet Explorer now this Internet
Explorer was part of the library that we
have imported similarly from the second
library we create a declare a object
named as HT and its type is HTML
document don't worry if you don't
understand the meaning of the two lines
that we have typed so far just make sure
that when I typed Internet Explorer or
HTML document I see here in the
drop-down list but when I delete these
two lines and I remove the libraries by
going to tools references and unchecking
these two options and then clicking on
ok so these libraries are now not part
of the code so when I try to find
Internet Explorer or
HTML document it should not give us a
suggestion that this is present so make
sure that you have the libraries
imported before you write the code
otherwise you will see errors in the
code so let's move on now I rename the
suppressor name as web scraping from
tests to make it more relevant and I go
back to references and again find the
two libraries which we have imported
earlier Microsoft HTML object library
and Microsoft Internet controls now
again I do the same steps dem ie as
Internet Explorer now ie is a object of
Internet Explorer that I have declared
here HT is a object of type HTML
document so that - I declare here and I
can use any name it is not mandatory to
use ie you can use ABC and it is a good
practice to put the comments here on the
top that in this step we have done
declaration
so after declaration the next step is
initialization now the objects that you
have declared you are going to
initialize them so to initialize we have
a keyword nameless set and we use
another keyword named as new so set ie
equal new Internet Explorer the object
ie is initialized as type Internet
Explorer so ie dot I can see list of
functions now which I can perform on
Internet Explorer you can see we have a
function named as navigate so our task
Falls to launch the browser and open a
URL so I can type the IE dot
navigate and you see here the options or
the argument which we need to pass in
this function all the arguments which
are in square brackets are optional URL
is a mandatory argument so I put a
google.com URL here in double quotes
because it's a string so that's how we
do did initialization now if I run the
code it will three
instance of Internet Explorer and it
will launch google.com but we cannot see
it reason is the browser is not visible
it trans the process in the background
you can check in task manager processes
so you need to set one property here to
make these browsers visible ie dot
visible equal true by default it has
false so now you run it again and you
will see Internet Explorer which opens
google.com so that what we have done so
far we have opened a browser and we have
launched a URL google.com now try this
part yourself and see if it opens your
own URL or not so if it works for you we
can continue with the next session on
how to access different elements on this
URL stay tuned to extreme automation to
learn more about this subject and we
also have a course on udemy which gives
you step by step instructions also which
will guide you how to create this whole
scraping application which you can use
in a very promising way
you