├── Section 2 ├── L2.1.xlsm └── L2.5_String Operation.xlsm ├── Section 3 ├── L3.2.xlsm └── L3.4_LateBinding.xlsm ├── Section 4 ├── HTML_example1 │ └── 001_simpleHTMLFile.html ├── HTML_example2 │ ├── pg1.html │ ├── pg10.html │ ├── pg2.html │ ├── pg3.html │ ├── pg4.html │ ├── pg5.html │ ├── pg6.html │ ├── pg7.html │ ├── pg8.html │ └── pg9.html ├── L4.2.xlsm ├── L4.6.xlsm └── L4.7.xlsm └── readme.md /Section 2/L2.1.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 2/L2.1.xlsm -------------------------------------------------------------------------------- /Section 2/L2.5_String Operation.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 2/L2.5_String Operation.xlsm -------------------------------------------------------------------------------- /Section 3/L3.2.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 3/L3.2.xlsm -------------------------------------------------------------------------------- /Section 3/L3.4_LateBinding.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 3/L3.4_LateBinding.xlsm -------------------------------------------------------------------------------- /Section 4/HTML_example1/001_simpleHTMLFile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Kamal Girdher's page 4 | 8 | 17 | 18 | 19 |

This is title for Color Selector

20 | 21 |
22 |

TEXTBOX

23 |
24 | 25 |

COMBOBOX

26 | 34 |

RADIO BUTTON

35 | 36 |
37 | 38 |
39 | 40 | 41 |

CHECKBOX

42 | 43 |
44 | 45 |
46 | 47 |
48 |

49 |

BUTTON

50 |

51 |
52 | 53 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 |

CIN

10001

18 | 19 |

Company Name

20 | 21 |
first company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

217763

55 |
59 | Next 60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 |

CIN

10010

18 | 19 |

Company Name

20 | 21 |
tenth company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

356346323

55 |
61 | Next 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |

CIN

10002

18 | 19 |

Company Name

20 | 21 |
Second company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Gurgaon

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

213123

55 |
63 | Next 64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |

CIN

10003

18 | 19 |

Company Name

20 | 21 |
Third company
26 | 27 |

Company Status

28 | 29 |
31 |

Open

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

321212

55 |
63 | Next 64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 |

CIN

10004

18 | 19 |

Company Name

20 | 21 |
fourth company
26 | 27 |

Company Status

28 | 29 |
31 |

Open

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

1221312

55 |
60 | Next 61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |

CIN

10005

18 | 19 |

Company Name

20 | 21 |
fifth company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

642523

55 |
63 | Next 64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 |

CIN

10006

18 | 19 |

Company Name

20 | 21 |
sixth company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

3452343

55 |
61 | Next 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 |

CIN

10007

18 | 19 |

Company Name

20 | 21 |
seventh company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

913201

55 |
61 | Next 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 |

CIN

10008

18 | 19 |

Company Name

20 | 21 |
eighth company
26 | 27 |

Company Status

28 | 29 |
31 |

Open

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

54352

55 |
60 | Next 61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /Section 4/HTML_example2/pg9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Company Details

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 30 | 33 | 34 | 35 | 36 | 37 | 42 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 |

CIN

10009

18 | 19 |

Company Name

20 | 21 |
ninth company
26 | 27 |

Company Status

28 | 29 |
31 |

Strike Off

32 |
38 | 39 |

RoC

40 | 41 |
43 |

RoC-Mumbai

44 |
49 | 50 |

Registration Number

51 | 52 |
54 |

42535222

55 |
59 | Next 60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /Section 4/L4.2.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 4/L4.2.xlsm -------------------------------------------------------------------------------- /Section 4/L4.6.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 4/L4.6.xlsm -------------------------------------------------------------------------------- /Section 4/L4.7.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgirdher/webScrapingUsingVBA/9a9a64ac5dd0c819205a8d8df9d9a8d62cbbb050/Section 4/L4.7.xlsm -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ### Web Scraping using Microsoft Excel VBA [Complete Course on Udemy] 2 | 3 | #### Author : Kamal Girdher 4 | #### Youtube : https://www.youtube.com/c/xtremeExcel 5 | #### Telegram : https://t.me/letsautomate 6 | 7 | -------------------------------------------------------------------------- 8 | 9 | ## Index 10 | 11 | to be updated 12 | 13 | -------------------------------------------------------------------------- 14 | ## 1. Introduction & Disclaimer 15 | 16 | ### 1.1 What is Screen Scraping / Data Scraping? 17 | 18 | Screen scraping is a practice of collecting all visual data from a website for use elsewhere. We typically automate the process by writing a script or using a software. 19 | 20 | ### 1.2 Is Scraping Legal? 21 | 22 | It is not, unless you are scraping your own website or blog. We therefore do not promote Data Scraping in any way. Before you continue with this course, you accept that you won't misuse the content for any unauthorized or illegal activity. 23 | 24 | -------------------------------------------------------------------------- 25 | 26 | ## 2. VBA Refresher [Optional] 27 | 28 | > **NOTE :** If you are not comfortable in VBA, refer [Excel macros/VBA Course on Youtube.](https://www.youtube.com/watch?v=dYHgr2murPk&list=PL1R_HJw0CDYKjmUxI3IKyuJcIKnWHVcuj) 29 | 30 | ### 2.1 Subprocedures & Functions 31 | 32 | A **subprocedure** is a series of VB statements enclosed by the Sub and End Sub. It performs a task and then returns control to the calling code, but it does not return a value to the calling code. 33 | 34 | ```vba 35 | Sub nameOfSubprocedure() 36 | 37 | End Sub 38 | ``` 39 | 40 | A **function** on other hand is a series of VB statements enclosed by the Function and End Function. It performs a task and then returns control to the calling code. When it returns control, it also returns a value to the calling code. 41 | 42 | ```vba 43 | Function nameOfFunction() 44 | 45 | nameOfFunction = 46 | End Function 47 | ``` 48 | 49 | > To learn more about functions and subprocedures, refer this [tutorial about Functions & Subprocedures](https://www.youtube.com/watch?v=1KDdu4BOZSA&list=PL1R_HJw0CDYKjmUxI3IKyuJcIKnWHVcuj&index=7&t=0s) 50 | 51 | 52 | ### 2.2 Variable Declaration and Object Initialization 53 | 54 | **Variables** can store information required to use in our program. These are used to store values of various data types. 55 | 56 | #### Declare a variable 57 | ```vba 58 | Dim a As Integer 59 | 60 | Dim b As String 61 | 62 | Dim c As Variant 63 | ``` 64 | 65 | #### Initialize a variable 66 | ```vba 67 | a = 10 68 | 69 | b = "Kamal" 70 | ``` 71 | 72 | To understand variables in detail, refer these tutorials: 73 | 74 | a. [Option Explicit & Implicit](https://www.youtube.com/watch?v=mojNkrnt_YA&list=PL1R_HJw0CDYKjmUxI3IKyuJcIKnWHVcuj&index=5&t=0s) 75 | 76 | b. [Dim, Public, Private and Global Keywords](https://www.youtube.com/watch?v=33JmyY83IpA&list=PL1R_HJw0CDYKjmUxI3IKyuJcIKnWHVcuj&index=6&t=5s) 77 | 78 | 79 | #### Declare an Object 80 | ```vba 81 | Dim o as Object 82 | 83 | Dim e As Excel.Application 84 | 85 | Dim o As Outlook.Application 86 | ``` 87 | 88 | #### Initialize an Object 89 | ```vba 90 | Set e = new Excel.Application 91 | 92 | Set o = new Outlook.Application 93 | ``` 94 | -------------------------------------------------------------------------- --------------------------------------------------------------------------------