JSFiddle - React, Tailwind, and code Playground

by Uday Hiwarale

HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<a href="http://www.askmebazaar.com/seller/SRI-SIVA-FANCY-STORES-s41184814?search=1&amp;defSearch=0">
  <div class="container store_details span3" style="margin-right:20px;">
    <div style="padding:7px;">
      <h4>
                                 SRI SIVA FANCY STORES                            </h4>
      <p>
        <strong>
                                    Address :</strong>15. nagar bustand, vijayawada, Visakhapatnam, , India, 530020
        <br>
        <strong>Mobile :</strong> 7075399197-
        <br>
        <strong>Email :</strong> [email protected] </p>
    </div>
  </div>
</a>

<a href="http://www.askmebazaar.com/seller/sv-electrical-s71380183?search=1&amp;defSearch=0">
  <div class="container store_details span3" style="margin-right:20px;">
    <div style="padding:7px;">
      <h4>
                                .sv electrical                            </h4>
      <p>
        <strong>
                                    Address :</strong>main road,gajuwaka,beside ramachandra hotel,Gajuwaka, Visakhapatnam, , India, 530026
        <br>
        <strong>Mobile :</strong> 9949277000-
        <br>
        <strong>Email :</strong> [email protected] </p>
    </div>
  </div>
</a>

JavaScript

var data = [];
$('body').find("a[href^='http://www.askmebazaar.com/seller']").each(function(index){
    data[index] = {};
    data[index].name = $(this).find('h4').text().trim();
    
    var pText = $(this).find('p').text();
    
    regPatNum = /[0-9+-]{7,45}/mi;
    numMatch = pText.match(regPatNum);
    data[index].phone = numMatch[0].replace(/[-]{1}$/,'');
    
    regPatemail = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/mi;
    emailMatch = pText.match(regPatemail);
    data[index].email = emailMatch[0];
});

copy(data);

//http://konklone.io/json/