Scrap List of films

How I can get all elements selected in image
if I use querySelectorAll(“.bslider-item”) i recieve a nodelist with many elements and in appzard show just {}. I want get just title, href, img src and info.

1 Like

Show some relevant blocks

1 Like

Can you PM me your AIA ?

1 Like

estudoQuerySelector.aia (76.6 KB)
I can send here. No problem! I apreciate your help!

It is showing empty because the return data type cannot be converted to String.
So, you need to return a String from your JavaScript’s code.

To get all titles,

function printTitles() {
var elements = document.getElementsByClassName("gPoster");
var text;
for (var i = 0; i < elements.length; i++) {
  text += elements[i].title + ", ";
}
}
printTitles()

To get all hrefs,

function printHrefs() {
var elements = document.getElementsByClassName("gPoster");
var text;
for (var i = 0; i < elements.length; i++) {
  text += elements[i].href + ", ";
}
}
printHrefs()

To get all Img sources,

function printImgSrc() {
var elements = document.getElementsByClassName("img");
var text;
for (var i = 0; i < elements.length; i++) {
  text += elements[i].src + ", ";
}
    return text;
}
printImgSrc();

I checked the website and completed the project for you :grinning:

AIA :
estudoQuerySelector.aia (79.8 KB)

Remember : I don’t advise you to do web scrapping. You should make API for it. Or if it’s not yours then, the developer should provide APIs to get data. You must have the site owner’s permission to do web scrapping on his website.

2 Likes

Oh my God!!! Thanks for ALL!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.