Complete Web Automation With Excel Vba

Tags: Excel VBA

Fill Out Web Forms Dynamically, Navigate Web Pages Intuitively, And Extract & Manipulate Data To Increase Efficiency!

Last updated 2022-01-10 | 4.8

- Locate elements using Basic Strategies (ID
- Name
- Tag
- Class)
- Search for Links using Link Text or Partial Link Text!
- Master XPath Location strategies and functions for hard to pinpoint elements

What you'll learn

Locate elements using Basic Strategies (ID
Name
Tag
Class)
Search for Links using Link Text or Partial Link Text!
Master XPath Location strategies and functions for hard to pinpoint elements
Deal with Popups
Alerts
Notifications and Frames like a boss!
Utilize Attributes to unearth embedded content
Pinpoint elements using Relative or Absolute Xpath
Learn the secret benefits of CSS Selectors
View and Parse inner html document information
Use free extensions and tools to locate best Xpath or CSS Selectors
Capture Groups of Elements into Arrays
Lists or Straight to Excel!
Sort and Remove Duplicates from a List Object
Locate all sub elements of a div
table
or larger parent element
Determine if element Exists
is Enabled
Hidden
Selected
Checked or Unchecked
Evaluate hidden CSS Properties
such as 'width'
'background color'
etc
Understand Regular Expression (RegEx) patterns and using pattern matching
Get element Position and Size and Scroll element into View when necessary
Create custom error messages to evaluate comparison (Equality
Contains
NotEquals
Matches
Fail…)
Discern the difference between Assert and Verify operators
Programmatically hover
click
click and hold
release
right click and double click with the Mouse
Send Keyboard combination presses as well as regular word character presses to the browser
Drag and Drop elements or text to another area or drag files for Upload programmatically
Control Timeouts and Wait default settings for PageLoad
Element searches and Server timeouts
Delay execution until controls are Visible
Enabled
Text is displayed or changed
Checkboxes/Optionbuttons are selected
Wait for CSS special values change or meet conditions
Log In using set credentials to site
Test for the presence of Dialog popups
Navigate with Basic Web Controls - Back
Forward
Reload
Close Driver
Close Single page
Urls
Save and Load specific user profile for WebDriver execution
Enter and Exit specific embedded Frame controls and their html content
Open
Access and toggle multiple tabs/windows and Select by Index
Title or Window Handle
Resize and Position Browser window to user specifications
Save Screenshot of Browser
Web Element(s)
or entire Desktop to Excel or to a file
Copy Image directly to Excel OR to Clipboard
Change image dimensions and resize
Compare multiple image files
generating an image of differences
Cast image elements into ActiveX Image Control on worksheet or Userform!
Convert Web-Table into TableElement Object and manipulate as array or directly to Excel
Extract specific Web-Table column(s) instead of whole table!
Dynamically select one or more Dropdown or Listbox options programmatically or using mouse clicks
Deselect all options or explore 'Options' collection and properties

* Requirements

* You should already have Microsoft Excel (version 2003
* 2007
* 2010
* 2013 or 2016). Obviously the newer the better
* but VBA works the same in all versions. It's just that newer versions have more options
* thus more VBA Commands to control those options.
* Very very basic Excel skills needed for this course. IF you know Basic to Intermediate Excel VBA
* you can surely find more ways to utilize this info
* but is not required as I explain everything in detail.

Description

  • Locate elements using Basic Strategies (ID, Name, Tag, Class)
  • Search for Links using Link Text or Partial Link Text!
  • Master XPath Location strategies and functions for hard to pinpoint elements
  • Deal with Popups, Alerts, Notifications and Frames like a boss!
  • Utilize Attributes to unearth embedded content
  • Pinpoint elements using Relative or Absolute Xpath
  • Learn the secret benefits of CSS Selectors
  • View and Parse inner html document information
  • Use free extensions and tools to locate best Xpath or CSS Selectors
  • Capture Groups of Elements into Arrays, Lists or Straight to Excel!
  • Sort and Remove Duplicates from a List Object
  • Locate all sub elements of a div, table, or larger parent element
  • Determine if element Exists, is Enabled, Hidden, Selected, Checked or Unchecked
  • Evaluate hidden CSS Properties, such as 'width', 'background color', etc
  • Understand Regular Expression (RegEx) patterns and using pattern matching
  • Get element Position and Size and Scroll element into View when necessary
  • Create custom error messages to evaluate comparison (Equality, Contains, NotEquals, Matches, Fail…)
  • Discern the difference between Assert and Verify operators
  • Programmatically hover, click, click and hold, release, right click and double click with the Mouse
  • Send Keyboard combination presses as well as regular word character presses to the browser
  • Drag and Drop elements or text to another area or drag files for Upload programmatically
  • Control Timeouts and Wait default settings for PageLoad, Element searches and Server timeouts
  • Delay execution until controls are Visible, Enabled, Text is displayed or changed, Checkboxes/Optionbuttons are selected
  • Wait for CSS special values change or meet conditions
  • Log In using set credentials to site
  • Test for the presence of Dialog popups
  • Navigate with Basic Web Controls - Back, Forward, Reload, Close Driver, Close Single page, Urls
  • Save and Load specific user profile for WebDriver execution
  • Enter and Exit specific embedded Frame controls and their html content
  • Open, Access and toggle multiple tabs/windows and Select by Index, Title or Window Handle
  • Resize and Position Browser window to user specifications
  • Save Screenshot of Browser, Web Element(s), or entire Desktop to Excel or to a file
  • Copy Image directly to Excel OR to Clipboard
  • Change image dimensions and resize
  • Compare multiple image files, generating an image of differences
  • Cast image elements into ActiveX Image Control on worksheet or Userform!
  • Convert Web-Table into TableElement Object and manipulate as array or directly to Excel
  • Extract specific Web-Table column(s) instead of whole table!
  • Dynamically select one or more Dropdown or Listbox options programmatically or using mouse clicks
  • Deselect all options or explore 'Options' collection and properties

Course content

13 sections • 150 lectures

Introduction and Course Download Files Preview 03:07

Introduction to the course and Downloadable files.

*See why Selenium is a gazillion times better than traditional ways of controlling web sites.

Getting FAST Help and Other Freebies with Excel Ninjas Group Preview 02:05

Getting & Installing Selenium Preview 07:30

Here's how to get set up with Selenium with Excel.

Installation Troubleshooting (skip if you don't need this!) Preview 02:18

This document is to help those who have had trouble after attempting the installation. These tips will get you patched up and on your way!

Opening a Web Page with Multiple Browsers (2 Methods) Preview 09:23

Web Elements 101 - Type in Textbox and Click Search Button (ID,Name Selectors) Preview 09:21

HTML Overview - Popular Tags and Attributes Preview 10:01

Strategies - "Tag" Preview 04:16

Awful-Valentine Site Expired, But We Downloaded It! Preview 02:41

Strategies - "Class" Preview 04:45

Exercise 02a - Question Preview 00:12

Exercise 02a - Answer Preview 04:49

Strategies - "LinkText" Preview 01:19

Looking At Attributes - More Than Just TEXT! Preview 03:13

Strategies - "PartialLinkText" Preview 01:37

Strategies - "CSS Selectors" Intro Preview 07:16

How to Install a Chrome Extension Preview 00:57

CSS Selector Helper for Chrome Preview 03:57

CSS Selector Tool - ChroPath and Technical Demonstration Preview 08:39

BONUS - ChroPath Serious Upgrades - Now Called SelectorsHub Preview 10:20

BONUS - Set Value versus SendKeys To TextBox Preview 11:14

BONUS - Create or Change Any Attribute Using Javascript Preview 10:49

BONUS - New Change Attribute Custom Function and Huge Demo Preview 08:30

Set Attributes With JavaScript Easily! Preview 00:09

Introduction to XPath Preview 05:04

XPath Helper Tool Preview 04:12

ChroPath with XPath for Relative and Absolute Reference Types Preview 05:08

XPath Function - Contains() Preview 04:01

XPath Function - Text() Preview 01:44

XPath Function - AND, OR Preview 02:22

XPath Function - Starts-With() Preview 01:00

XPath - Axes Preview 07:21

XPath Function - Last() Preview 02:32

Selecting a Specific Index for XPath Query! Preview 03:49

Exercise 03a - Question Preview 00:12

Exercise 03a - Answer Preview 07:54

More XPath Resources Preview 00:14

Selenium VBA Code Snippets - Chapter 1-3 Preview 00:04

Working With a Group Of Elements (FindElements) Preview 04:34

Looping Through a Set of Elements, Declaration Tips Preview 04:11

Grab the Text For Each Element Into A List Preview 03:05

Grabbing All Attribute Values into a List Preview 01:18

Add, Remove or Change an Element from a List Preview 05:01

Get Count of List Items or Web Elements Preview 01:35

Remove Duplicates Elements from List Preview 01:01

Sorting Your List Preview 00:56

Importing Items to Excel Directly! Preview 01:55

Looping Through a List of Attributes for a Set of Elements Preview 08:23

Exercise 04a - Question Preview 00:12

Wikipedia, get all links, then visit the 10th link after sorting

Exercise 04a - Answer Preview 06:15

Wikipedia, get all links, then visit the 10th link after sorting!

Finding Elements within an Element Preview 03:19

Find the Active Element Preview 03:15

Understanding the 'By' Object Preview 02:33

Does The Element Exist Using 'By' Object Preview 02:18

Does Element Exist Using WebElement Object (2 Ways!) Preview 04:24

Value, Tagname, Text & Css Properties Preview 05:20

Specialty Text Variations Preview 01:25

Discover Whether Element is Displayed, Enabled, Present, Selected... Preview 04:57

Pagination - Clicking Next Until You Reach the Last Page Preview 07:38

Element Position and Size Preview 02:05

Scrolling Element Into View Preview 02:21

Regular Expression Patterns! Preview 13:35

Return Text Based on Regular Expression (RegEx) Preview 04:41

Automatically Download File to Custom Folders with SetPreference() Preview 07:17

SetPreference Extra example! Preview 00:08

Assert vs Verify Preview 01:53

Equals Comparison Operator Preview 04:46

Not Equals Preview 00:43

Contains Preview 01:26

Custom Error Messages Preview 01:19

Matches & NotMatches Preview 03:09

Fail, False and True Preview 02:26

Selenium VBA Code Snippets - Chapter 4-6 Preview 00:04

Click, Click and Hold, Release, Right Click & Double Click Preview 07:07

SendKeys and Keys Modifiers Preview 05:18

KeyDown, KeyUp Preview 02:07

Exercise 07a - Question Preview 00:12

Exercise 07a - Answer Preview 04:21

DragAndDrop - Swapping Elements, Better with JavaScript Preview 05:20

DragAndDrop - Element Disappears Once Dropped Preview 01:28

DragAndDrop - Dragging Text Programmatically Preview 01:17

DragAndDrop - Dragging File for Upload Programmatically Preview 02:38

Hover MenuItem and Click On Submenu Item Preview 04:33

Clear Out Text Entry Element Preview 00:52

TimeOuts and Wait DEFAULTS Preview 02:26

Basic Wait Command Preview 01:51

Exercise 08a - Question Preview 00:12

Exercise 08a - Answer Preview 03:01

Finding Elements With a Custom TimeOut Duration Preview 03:22

Wait Until Element is Displayed Preview 01:49

Wait For Specific Text or a Specific Attribute to Appear! Preview 07:33

Wait For CSS Special Value to Appear or Change Preview 05:47

Wait for Text To Appear or Change Preview 03:45

WaitNotElement and By.Any Preview 03:55

WaitEnabled or Wait Until Element is Displayed Preview 03:41

Wait For Selection With Checkboxes and OptionButtons Preview 02:01

Selenium VBA Code Snippets - Chapter 7-8 Preview 00:04

Alerts - Using Multi Options (OK and Cancel, OK Only & Text) with An Alert Preview 08:58

SetCredentials Troubleshooting Tips and Authorization Dialog Popups Preview 05:07

Custom Function Testing Whether Dialog Popup Is Present Preview 06:42

Basic Navigation - Back, Forward, Reload, Close Driver, Close Single page, Url Preview 06:11

Setting A Custom Profile For WebDriver Session Preview 07:17

How To Add A Chrome Extension To ChromeDriver Sessions Preview 06:26

Restoring a Web Session Using Cookies (Saved in Object Variable) Preview 09:15

Restoring a Web Session Using Cookies (Saved in Worksheet) Preview 04:40

Add Special Arguments to Customize Browser Options - Incognito or Hidden Window Preview 04:52

Special Arguments List Preview 00:06

Using a Portable Version of Chrome - GoogleChromePortable Preview 05:58

AddArguments Link and Examples Preview 00:10

Grab Html Page Source and Text From Parent Elements Preview 04:03

Exercise 09a - Question Preview 00:12

Exercise 09a - Answer Preview 04:11

Keep a Permanent WebDriver that Doesn't Close On Its Own Preview 07:02

Frames and Frame Nagivation Preview 07:15

BONUS - Frame Finder Custom Function Preview 10:28

BONUS - Switch To Nested Frame Custom Function Preview 05:55

Window, Tab Manipulation by Title, Index, Previous and Next Preview 06:14

Accessing Window By Name, Handle Preview 02:16

Close All Tabs Except Main Tab Preview 05:25

Several Ways To Open a New Tab In Current Session Preview 03:41

Window Sizing and Position Preview 03:36

Selenium VBA Code Snippets - Chapter 9 Preview 00:04

Save a Screenshot of Your Browser, Dispose Image in System Memory Preview 04:57

Save Web Element as Image Preview 03:06

Save Entire Desktop Screen as Image Preview 01:52

Copy Image Directly to Excel OR To Clipboard Preview 03:16

Image Dimensions and Resizing Preview 03:55

Compare Two Images with CompareTo and DiffCount Preview 04:35

Put Web Image Into Worksheet ActiveX Image Control Preview 04:08

Load Image Into Userform Image Preview 03:06

Converting a Web Table to TableElement Object and Inserting into Worksheet Preview 04:22

Manipulating TableElement Data as Array onto Worksheet Preview 10:54

Loop Through Elements in Specific Column Only Preview 03:39

Loop Through Multiple Specific Columns Using OR Operator Preview 01:15

Put Specific Columns into List Object, To Excel Easily Preview 02:35

Exercise 11a - Question Preview 00:12

Exercise 11a - Answer Preview 09:23

Declare SelectElement, Read and Write Dropdown Control Preview 04:13

Select Using the Index Number Preview 01:13

Select Using Internal Option Value Preview 02:13

All About The Options Collection Preview 03:48

Controlling Multiple Select ListBoxes and Gathering Selected Options Preview 03:57

Using The Mouse To Select Multiple Options Preview 03:31

Deselecting All Options or Specific Options Preview 02:03

Selenium VBA Code Snippets - Chapter 10-12 Preview 00:04

Exercise 12a - Question Preview 00:12

Exercise 12a - Answer Preview 18:32

Error Loading Extension Help Preview 06:09

Manisha created a method for disabling the annoying extension error popup. Here's the source code:


'PUT THIS STUFF IN YOUR EXCEL DOCUMENT

    Sub Automate

    Dim bot As New WebDriver

    Shell "wscript.exe ""C:\Documents\PORTAL_Automation\CHROME\ExtensionAlert.vbs"""

     

    With bot

    .Start "chrome", "https://en.wikipedia.org/wiki/Main_Page" 'finally open it now

    .Get "/"

    End With

     

    End Sub



'AND PUT THIS STUFF IN A TEXT DOCUMENT AND SAVE IT AS ExtensionAlert.vbs

     

    Set wshShell=Createobject("wscript.Shell")

    Do

    ret=wshShell.AppActivate("Error Loading Extension")

    Loop until ret=True

    wscript.Sleep 500

    ret=wshShell.AppActivate("Error Loading Extension")

    If ret=True Then

    ret=wshShell.AppActivate("Error Loading Extension")

    wscript.Sleep 10

    wshShell.sendkeys "{enter}"

    End If


BIG THANKS TO MANISHA!!!


Thanks

Dan

Error Loading Extension Help - Source Code Preview 00:21

BONUS LECTURE Preview 00:03