Created
October 26, 2016 11:08
Revisions
-
Jack Mahoney created this gist
Oct 26, 2016 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ // execute in chrome snippets section on a page such as http://digitalagencynetwork.com/agencies/melbourne/ // copy result into a csv file an voila var $ = jQuery; var results = []; $('.entry .threecol-two.last').each(function(){ var title = $(this).find('h3').text(); var address = $(this).find('a').attr('href'); var emailMatch = $(this).first('h6').text().match(/[\w\.]+@[\w\.]+/); var email = emailMatch ? emailMatch[0] : 'unknown'; results.push([title,address,email].join(',')); }); console.log(results.join('\n'));