Yelp Scraper Bot Using iMacros Script

Extract data from Yelp with a push of a button. This Yelp scraper will extract the Yelp business page URL, business name, number of reviews, address, phone number and website. Results are saved in a CSV file that can easily be filtered in Excel. The file will be located in the folder C:\Users\USERNAME\Documents\iMacros\Downloads. Username will be your unique PC username. If you have any questions drop a comment below or shoot me an email. Sign up for my newsletter for more Yelp scripts.

SCRIPT:

SET !ERRORIGNORE YES

SET !TIMEOUT_STEP 1
TAB T=1
‘Add &rpp=40 to end of Yelp URL for 40 results per page
TAG POS={{!LOOP}} TYPE=A ATTR=CLASS:”biz-name js-analytics-click” EXTRACT=HREF
SET !VAR1 {{!EXTRACT}}

TAB OPEN
TAB T=2
URL GOTO={{!VAR1}}

TAG POS=1 TYPE=H1 ATTR=CLASS:”biz-page-title*” EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}

TAG POS=1 TYPE=SPAN ATTR=CLASS:”review-count rating-qualifier” EXTRACT=TXT
SET !VAR3 {{!EXTRACT}}

TAG POS=1 TYPE=STRONG ATTR=CLASS:”street-address” EXTRACT=TXT
SET !VAR4 {{!EXTRACT}}

TAG POS=1 TYPE=SPAN ATTR=CLASS:”biz-phone” EXTRACT=TXT
SET !VAR5 {{!EXTRACT}}

TAG POS=1 TYPE=SPAN ATTR=TXT:”Business website”
TAG POS=R1 TYPE=A ATTR=TARGET:”_blank” Extract=TXT
SET !VAR6 {{!EXTRACT}}

SAVEAS TYPE=EXTRACT FOLDER=* FILE=Yelp.csv

SET !EXTRACT NULL

WAIT SECONDS=1

TAB CLOSE

 

Leave a Reply

Your email address will not be published. Required fields are marked *