internet explorer - How to retrieve text in Div Class using Excel Macro? -


i used able retrieve text website using excel macro , populate in excel file.

in case, need word 'customer service & support' website; below html code:-

<div class="thumbnailcnt" style="height: 400px;">       <div class="profthumb nonemployee "><div class="profimg"><img src="http://wwwin.cisco.com/dir/photo/zoom/abhms.jpg" alt="directory photo of abhilash ms if available" class="mastertooltip" title="directory photo of abhilash ms if available"></div></div>              <span id="iwelink" style="line-height: 12px; font-size:85%; position:relative; top:-4px; top:-12px\0/; top:-12px\9; *top:-12px; _top:-12px;">     </span>         <!--  -->     <h2 class="username">abhilash ms         </h2>   <p class="userid">       (abhms)   </p>     <div style="margin-bottom: 38px">                         customer service & support                                                     <a onclick="dirapp.encodepluslink('/dir/empadvquery.go?title=customer service &amp; support&amp;accmsg=true&amp;rcsrftoken=56d41e9e-b391-4f99-a393-5ff4ccaf7b2a');return false;" class="action_icon mastertooltip" href="#" title="show employees 'customer service & support' title"><div id="searchjt"></div></a>                                 </div>     <div class="vcardpos">         <a class="action_icon mastertooltip" href="/dir/vcard/abhms.vcf" title="download contact"><div id="downloadicon"></div></a>     </div>   </div> 

however unable retrieve word using vba code (which have been using):-

set ie = createobject("internetexplorer.application") ie.visible = true  row = 2 sheets("tac").range("a1").end(xldown).row     application.statusbar = round(row / sheets("tac").range("a1").end(xldown).row * 100, 0) & "% done..."     ie.navigate "http://...." & sheets("tac").cells(row, 1)     application.wait (now() + timevalue("0:00:03"))     while ie.busy         doevents                 loop                       ccoid = ie.document.getelementsbyclassname("userid")(0).innertext     on error goto nodata      ccoid = ie.document.getelementsbyclassname("userid")(0).innertext     ccoid = left(ccoid, len(ccoid) - 2)     ccoid = mid(ccoid, 2, len(ccoid) - 1)          if ccoid = sheets("tac").cells(row, 1)             tacgrp = ie.document.getelementsbyclassname("des")(0).innertext             sheets("tac").cells(row, 2) = tacgrp         end if  nodata:     ccoid = ""     on error goto -1     next row 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -