Skip to content

Free Excel Training 2022

Excel Training Tutorials 2022

  • Home
    • About
    • Contact
    • Privacy Policy
  • Excel Essentials
  • Excel Functions
    • Excel 2003
    • Excel 2007
    • Excel 2010
  • Excel in Hindi
  • Excel VBA
    • Excel 2003 VBA
    • Excel 2007 2010 2013 VBA
  • YouTube
    • YouTube Advanced VBA
    • YouTube Hindi
  • Books
  • What’s New

Month: August 2017

Get Meta Data from Webpage

Posted on August 7, 2017August 7, 2017 by Dinesh Kumar Takyar

How to get meta data from webpage automatically using VBA. Meta tags are tags like ‘description’, ‘keywords’, etc. that are not displayed on the web page but used by search engines. Watch the video below:

https://www.exceltrainingvideos.com/wp-content/uploads/2017/08/Get-Meta-Data-from-Webpage.mp4

 

Watch this video on YouTube.

Here’s the complete VBA code to extract the meta tags from web pages like ‘yahoo’, ‘youtube’, etc.

Option Explicit

Sub getMetaData()
Dim ie As New InternetExplorer
Dim myLink As String
Dim wks As Worksheet

Set wks = Sheet1
myLink = wks.Range(“A2”).Value
ie.Visible = True

ie.Navigate myLink

Do
DoEvents
Loop Until ie.ReadyState = READYSTATE_COMPLETE

Const meta_tag As String = “meta”
Const meta_name As String = “keywords”
‘Const meta_name As String = “description”
Dim Doc As HTMLDocument
Dim metaElements As Object
Dim element As Object
Dim keywd As String

 

Set Doc = ie.Document
Set metaElements = Doc.all.tags(meta_tag)

For Each element In metaElements
If element.Name = meta_name Then
keywd = element.Content
End If
Next

‘MsgBox keywd
Range(“B2”).Value = keywd
Columns(“B”).AutoFit

End Sub

Further reading:

Scraping Web Page Tables Data Using VBA

 

Posted in Excel VBA 2013Tagged get meta data from webpage, how to automatically get web page meta data using vba 3 Comments

Posts navigation

Newer posts

Change Language

en English
af Afrikaanssq Albanianam Amharicar Arabichy Armenianaz Azerbaijanieu Basquebe Belarusianbn Bengalibs Bosnianbg Bulgarianca Catalanceb Cebuanony Chichewazh-CN Chinese (Simplified)zh-TW Chinese (Traditional)co Corsicanhr Croatiancs Czechda Danishnl Dutchen Englisheo Esperantoet Estoniantl Filipinofi Finnishfr Frenchfy Frisiangl Galicianka Georgiande Germanel Greekgu Gujaratiht Haitian Creoleha Hausahaw Hawaiianiw Hebrewhi Hindihmn Hmonghu Hungarianis Icelandicig Igboid Indonesianga Irishit Italianja Japanesejw Javanesekn Kannadakk Kazakhkm Khmerko Koreanku Kurdish (Kurmanji)ky Kyrgyzlo Laola Latinlv Latvianlt Lithuanianlb Luxembourgishmk Macedonianmg Malagasyms Malayml Malayalammt Maltesemi Maorimr Marathimn Mongolianmy Myanmar (Burmese)ne Nepalino Norwegianps Pashtofa Persianpl Polishpt Portuguesepa Punjabiro Romanianru Russiansm Samoangd Scottish Gaelicsr Serbianst Sesothosn Shonasd Sindhisi Sinhalask Slovaksl Slovenianso Somalies Spanishsu Sudanesesw Swahilisv Swedishtg Tajikta Tamilte Teluguth Thaitr Turkishuk Ukrainianur Urduuz Uzbekvi Vietnamesecy Welshxh Xhosayi Yiddishyo Yorubazu Zulu

Please click the icon to access all YouTube videos, if you can't see the video on the main page:

View All Posts

View All Pages

Share with Friends:
              

Create a website that's free with GoDaddy!
Proudly powered by WordPress | Theme: sosimple by Fernando Villamor Jr..

Copyright ©2023 exceltrainingvideos.com