ankswe
(Ankit)
May 27, 2020, 10:35am
1
Hi,
I am trying to fetch Image URLs from
https://www.weibo.com/login.php?category=1760
See sample image highlighted in screenshot below
These images are contained in the HTML code like below
div class=“pic W_piccut_v”<
img >src<=“https://wx3.sinaimg.cn/crop.0.0.1080.804.240/69226ed0ly4gf68x3il7dj20u00mcdhp.jpg ” alt=“”
/div
Please suggest how JS can be created and added to get this URL.
Thanks
ppr
(Peter Preuss)
May 27, 2020, 10:54am
2
@ankswe
In general image url can be retrieved with get Attribute activity and src Attribute
for retrieving the images following can be used:
find children
data scrapping with customized extract configuration on src attribute
1 Like
ankswe
(Ankit)
May 27, 2020, 10:56am
3
As suggested earlier, “src” is not returned using Get Attribute, and with Find Children, I am not able to see any UiElement. Can you try this with website suggest sample code.
ppr
(Peter Preuss)
May 27, 2020, 11:19am
4
@ankswe
have a look here:
clicking the configurator pointed to div. But manually adoption to following is bringing urls as shown above:
<extract>
<column exact="1" name="Column1" attr="src">
<webctrl tag="div" class="UG_list_b"/>
<webctrl tag="div" class="pic W_piccut_v" idx="1"/>
<webctrl tag="img" idx="1" />
</column>
</extract>
the important changes are the added
<webctrl tag="img" idx="1" />
and the attr change from text to src
5 Likes
ankswe
(Ankit)
May 27, 2020, 12:04pm
5
Thanks, this is working. But few questions to enhance my understanding, please confirm on below
Please confirm whether we are adding "webctrl tag=“img” idx=“1” " because we want to the last level data from the img tag, right ?
Since the attribute that contains value in “src” so we changed it to “src” instead of “Text”
But is “Text” default attr, because it was not present in the original html.
Thanks again for your help and it is a new learning for me.
Regards
ppr
(Peter Preuss)
May 27, 2020, 12:23pm
6
@ankswe
src is an attribute from html element of tag img
so we need to point the selector to this element. Sometimes indicate item needs some post work as in this situation
Yes default is the text attribute used for the retival. Other attributes are usefull as well: href for links, src for image urls, class for reacting on formats …
ankswe
(Ankit)
May 27, 2020, 12:37pm
7
Thanks for your explanation. Really appreciate your help.
Regards
system
(system)
Closed
May 30, 2020, 12:37pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.