scraper script

node v4.9.1
version: 1.0.0
endpointsharetweet
//jshint esversion: 6 const cheerio = require('cheerio'); var html = '<a href="/iv/executiveinfo.do?methodToCall=overview&id=17802097"class=head18darkgrey>Parin Gandhi</a><span class="float_left pipe"style=margin-top:5px>|</span><a href="/iv/companyinfo.do?methodToCall=overview&id=725038"class="bluefont float_left"style=margin-top:5px>CA, Inc.</a><hr class="clearfix header_line_dashed"size=1><div style=margin-top:5px;width:360px;float:left><div style=float:left;width:100% class=console_text><b>SAP BI Principal Applications Developer</b><br><span>Greater New York City Area, NY, United States</span><div style=margin-top:10px><div><a href=mailto:parin.gandhi@ca.com class=bluefont target=_top>parin.gandhi@ca.com</a></div>Corp. Phone: +1 800 225 5224</div></div></div><div style=float:right;width:90px;text-align:right><a href="/iv/executiveinfo.do?methodToCall=overview&id=17802097#LinkedIn"><img alt=LinkedIn height=32 hspace=5 src=/iv/common/styles/images/icn_linkedin_32.png title=LinkedIn width=32 align=absmiddle vspace=5></a><div style=padding-left:5px></div></div><div class=source-container-hover><div class=source-middleBar-hover><div class="greytxt_11px source_mid_content-hover"><div style=float:left>Source(s):<img alt="Web References"height=12 hspace=3 src=https://d2cwur35ckvhb1.cloudfront.net/iv/common/static/styles/images/icn_cloud12_8bff992d38bc11f82e102b4c1524b04f.gif title="Web References"width=12 border=0 class=vertical_middle></div></div></div></div>'; var $ = cheerio.load(html); var name = $('.head18darkgrey').text(); var title = $('b').text(); var email = $('a[class=bluefont]').text(); console.log('name:', email, 'title:', title, 'email:', email);
Loading…

no comments

    sign in to comment