-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscraping.html
32 lines (28 loc) · 1.46 KB
/
scraping.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<body>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script><!-- jquery cdn -->
<script>
var url = "https://isha.sadhguru.org/in/en/yoga-meditation/yoga-program-for-beginners/inner-engineering/inner-engineering-online/contact-information";//paste the URL here
var Url = "http://localhost:8080/" + url;
$.ajax({
url: Url,
contentType: "json",
crossDomain: true,
success: function (response) {
var phone = response.match(/\+?\d?\d? ?-?\d{3}-?\d{2} ?\d-?\d{4}/g);
//matches +1 7878787878, +91 7878787878 ,7878787878,+91 95381 10008,+1 78787 87878
var email = response.match(/\w{1,}@\w{1,}.\w{1,3}/g);
console.log("email from page", email);
console.log("contact information from page", phone); // also it might bring many different data ids eg facebook
//so filter it out as user's need
//code to filter
// var phone = response.match(/\d{10}/g).filter((d) => { return (d[0] == 9 || d[0] == 8 || d[0] == 7) });//flitering numbers starting from 7,8,9
//to remove duplicates
//console.log("numbers from page", [...new Set(phone)]);
}
});
</script>
</body>
</html>