Scraping

Last Updated on February 4, 2022 by Jake Sheridan

Pre-Written Formulas for Scraping

Scrape data from any website using IMPORTXML

IMPORTXML("https://ahrefs.com/blog/keyword-research/","//title")

Scrape page title/title tag

IMPORTXML(A2,"//title/text()")

Scrape meta descriptions

IMPORTXML(A2,"//meta[@name='description']/@content

FormulaDescriptionExample
IMPORTXML("https://ahrefs.com/blog/keyword-research/","//title")Scrape data from any website using IMPORTXMLhttps://sheetsformarketers.com/
MID(MID(SUBSTITUTE(IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")),"www.",""),SEARCH("://",IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")))+3,SEARCH("/",SUBSTITUTE(IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")),"www.",""),9)-SEARCH("://",IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")))-3),FIND(".",MID(SUBSTITUTE(IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")),"www.",""),SEARCH("://",IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")))+3,SEARCH("/",SUBSTITUTE(IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")),"www.",""),9)-SEARCH("://",IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")))-3)),LEN(MID(SUBSTITUTE(IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")),"www.",""),SEARCH("://",IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")))+3,SEARCH("/",SUBSTITUTE(IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")),"www.",""),9)-SEARCH("://",IF(RIGHT(A2,1)="/",A2,CONCAT(A2,"/")))-3)))Extract the domain name extension from a URLhttps://sheetsformarketers.com/
IMPORTXML(A2,"//title/text()")Scrape page title/title taghttps://sheetsformarketers.com
IMPORTXML(A2,"//meta[@name='description']/@contentScrape meta descriptionshttps://sheetsformarketers.com