In the above photo photo you can see that the span tags has the same class in all the row it created but got different value include inside the span tag i.e :
<span_1 class=“c-span” > Facebook </span_1>
<span_1 class=“c-span” > Twitter </span_1>
<span_1 class=“c-span” > copy link</span_1>
So, now what i want to do is to get:
1.Facebook
2.Twitter
3.copy link
In a list form like Facebook, Twitter, copy link so that i can make a table for each value and make a list in my app … can anyone help me with it . Thankyou
If you Just Want The Text Of Facebook Copylink twitter and Embded
The Use The Following Javascript In Webviewer
To Get Text Of
Facebook
document.getElementsByClassName("a-font-primary-medium-xxs")[4].innerText;
Copylink
document.getElementsByClassName("a-font-primary-medium-xxs")[3].innerText;
Twitter
document.getElementsByClassName("a-font-primary-medium-xxs")[2].innerText;
Embed
document.getElementsByClassName("a-font-primary-medium-xxs")[5].innerText;
Use Following JS To Get The Volue
If You Want The All The Text Data In List So Use This
(function() {
var TextData = new Object();
TextData.Twitter = document.getElementsByClassName("a-font-primary-medium-xxs")[2].innerText;
TextData.Copylink = document.getElementsByClassName("a-font-primary-medium-xxs")[3].innerText;
TextData.Facebook = document.getElementsByClassName("a-font-primary-medium-xxs")[4].innerText;
TextData.Embed = document.getElementsByClassName("a-font-primary-medium-xxs")[5].innerText;
return JSON.stringify(TextData);
})();
It Will Give The Result Like This In json
{
"GetTwittertext":"Twitter",
"GetCopylinktext":"Copy Link",
"GetFacebooktext":"Facebook",
"GetEmbedtext":"Embed"
}
Got your points but it feels little bit complicated with me to do that randomly
can i use ‘for’ loops to extract data… Infact I need 200 songs name , its rank and artist name from billboard website they aren’t given any api for it i thought of this way by… but it’s become complex as i have to get innertext form same class element.
Thankyou so much for this it save my time.
I also get the js but its time consuming
And slow then wrapapi.com. Well I got few questions about wrapapi can you please give some time.
And Here’s the code if anyone need js.
var GetEle = document
.getElementsByClassName(“c-label”);
var Store = “”;
function clickme() {
for (var i = 0; i < GetEle
.length; i++) {
Store += GetEle[i].innerText
}
document.getElementById(“Show”)
.innerHTML = Store;
}