How do I scrape data from Web?

There are 4 classes listed

Please help me to execute my plan of getting images in a list.

You can use these two:

const coll1 = document.querySelectorAll("[data-image-effect]");

const coll2 = document.querySelectorAll("[data-image-hover]");

then use:

coll1[0] and coll2[0] to return their respective data (there are @ 6 images per dataset - same image different sizes)

You can then use text manipulation blocks to get the image urls.

It seems the default image may be the 360 one.
...

If you are using Kodular, next time please ask on the Kodular community, things are different there...(I see you did ask there...)

1 Like

There real fact I asked here was that the Kodular community is not active like 3-5 years before. There are no reply on my post since 2 days.

How to evaluate this code in Webviewer.EvaluateJS block?

Please provide me solution by grabbing my hand as I am new to the community after disorder of my mind.

Slightly different with webviewstring:

1 Like

Thank you Sir it helped me.

How to scrape data this is new data in the website?

I know i already asked it and get solved by @TIMAI2 , but this time it is different fethching. How do I scrape data from Web? - #15 by TIMAI2

help me to get this data to Webview.String

<body id="search-0-results-found-for-quot-kwtsr240011-x-quot" class="subpage template-search infinitescroll" data-header="1">

Looks like you should query the following when a search result is returned:

https://kinnko.com/search?q=KWTSR240011-X

document.querySelectorAll('h1.section-title')[0].innerHTML;

'Your search for "KWTSR240011-X" did not yield any results.'

to set webviewstring, should be:

window.AppInventor.setWebViewString(document.querySelectorAll('h1.section-title')[0].innerHTML)

1 Like

How can I send value to the web component?

And how can I be like you and learn like you and from where?, you are so great.

It is providing the value, but I chosen webview to hide but it always shown again and again without any Boolean value set by me.

Also I am showing my blocks and my app interface,

Where it is returning same value again and again,
Like I entered wrong SKU code then it will check it is found or not as per your above guide which is mind blowing, but also on the other hand I set the webview to visible false.

On the visible false I don't know how it can be visible and above label is showing that Found,

Please guide me after seeing my blocks and screenshots.
below is my webview after visible false

visible false webview screenshot below

below is my blocks and contains text block is also not working in this app or query

i am using the block in screen initialize screenshot below

Guide me if i am wrong in any block or you need more information on the matter :pray:

:question: Do you mean webviewer ?

Spend 30 years working with html/css/javascript/VBA/Google etc., 12 years working with AppInventor, and even then you will only have the tip of the iceberg. The internet is your friend when it comes to finding answers.

"Experience is the only genuine knowledge"

This however is a good place to learn: https://www.w3schools.com/

running a javascript in a webviewer will work whether the webviewer is visible or not.

Can't really help with your blocks, other than to observe that they look very confused, and it is not obvious as to what you are trying to achieve: you use Kodular, a webviewer and customwebview in your blocks, plus procedures that you do not show.

Visible = false

No Web Component in connectivity section

The problem is now solved by my hit and trial method which i think is temporary.

I want to scrape data to web to string.
span class = compare needed and span class = current

There should be sufficient examples in this thread already for you to resolve this.

I am not good and best in js please help me master, I tried with

window.AppInventor.setWebViewString(document.querySelectorAll('span.compare')[0].innerHTML)

It is not working.

The query looks OK:

image

This is working for me:

window.AppInventor.setWebViewString(document.querySelectorAll('span.compare')[0].innerHTML)

I have only one webview can I run multiple request at same time, but how to identify the particular request in it?

Add a marker / id to the setWebViewString command.

In which place and how?