Tricky Excel VBA IE automation question

Don_Mosquito

New Member
Joined
Aug 18, 2015
Messages
6
Hello everybody,

I have been spending the major part of my evening on researching a solution together with major try and error... but I am getting nowhere...

I have the following source code from a page (iconosquare.com), but the page seems to have a lot of javascript, although I can not see that in the HTML inspect on Chrome...
HTML:
<div class="image-wrapper">
        <input type="hidden" value="https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/12826269_473658709508624_652261004_n.jpg?ig_cache_key=MTIxMDMzMjI4NzU1OTIwNTMzMg%3D%3D.2.l" class="standard_resolution_source">
        <input type="hidden" value="1458502873" class="created_source">
        <a href="#/detail/1210332287559205332_288072495" class="lienPhotoGrid">
	<img src="https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/c148.0.784.784/12599512_1575861196037377_1980253214_n.jpg?ig_cache_key=MTIxMDMzMjI4NzU1OTIwNTMzMg%3D%3D.2.c">
	</a>
</div>
What I want to do is extract the URL (most important Url2 the thumbnail)
Url1:https://scontent.cdninstagram.com/t.../e35/12826269_473658709508624_652261004_n.jpg
Url2:https://scontent.cdninstagram.com/t...84/12599512_1575861196037377_1980253214_n.jpg

I tried:
1) MsgBox .getElementsByClassName("image-wrapper")(0).all
Which gives me "[object HTMLInputElement]" as message box

2)MsgBox .getElementsByClassName("image-wrapper")(0).getElementsByTag("a")
Which gives me "Object doesn't support this property or method"

As you see I am a little out of ideas here.... anyone who could give me a hand?
Appreciate it!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Ok... found it after even more search... sorry to bother

Pic_source_1 = .getElementsByClassName("image-wrapper")(0).getElementsByTagName("IMG")(0).src
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,557
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top