How to get some text from using Web component?

I want to get some text from a web component. I tried once but I got an error “Segment: Start is less than 1 (0)”.

I know this exists but it was not solved and was closed as well.
I would not want to show my blocks but my blocks are the same as these but I use different code


Can I fix it?
Thanks a lot!

I searched a lot but I did not find anything in the community. Even Booban’s solution didn’t work

Can you post your url ?

https://www.google.com/search?client=firefox-b-d&q=patna+current+pm2.5+level

I wanted to get the first number in that’s big font

  <div class="IZ6rdc">

I used this

I think I can do it. Let’s me try after lunch.

1 Like

Use this block :point_down:

1 Like

That’s a lot!!! I can’t believe you actually did that.

Can you give me a .aia so I could try it out?
Thanks a lot! :grinning:

No need for aia, blocks are draggable. Download them and drag them in creator

2 Likes

Didn’t know that.

It isn’t working. My workspace becomes green but no blocks to be seen. I am using Firefox and I am on Linux

animation15

1 Like

It works! I did not know that

Feature was introduced in 2019 :slight_smile: It only works with individual blocks and procedures if you download them as png.

1 Like

Ok, I tried it. It works perfectly! Thanks a lot! :grinning: :grinning: :grinning:

1 Like

I am sorry. I think in my block has 2 extra lines. I will remove it after some time. Thank you

It works but ok

rather than this long code you can use JavaScript to get the current pm2.5 level

document.getElementsByClassName("IZ6rdc")[0].textContent;

2 Likes

It works! And it’s smaller!