Read image in the page content

Add-in Express™ Support Service
That's what is more important than anything else

Read image in the page content
 
Aswathi aswathi




Posts: 9
Joined: 2010-09-06
Hello,

I have used following comment to read the images tag in page content when page load.

mshtml.HTMLImgClass In HTMLDocument.getElementsByTagName("img")


But it doesnt read the ad's images.. Can you please anyone help to read the ad's images.

I am using .NET and C#

Thanks for help.
Posted 13 Sep, 2010 04:24:45 Top
Andrei Smolin


Add-in Express team


Posts: 14210
Joined: 2006-05-11
Hi Aswathi,

If getElementsByTagName returns nothing then make sure that you work with a correct document and tag.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Sep, 2010 05:53:05 Top
Aswathi aswathi




Posts: 9
Joined: 2010-09-06
Hello Andrei Smolin,

Thanks for your response.
I have used the following code to read the img tags in the page content.

Code:[B]

For Each imga As mshtml.HTMLImgClass In HTMLDocument.getElementsByTagName("img")

If imga.parentNode.nodeName.ToString() = "A" Then

ik = imga.parentElement.getAttribute("href", i).ToString()


End If

If imga.parentNode.nodeName.ToString() = "a" Then
ik1 = imga.parentElement.getAttribute("href", i).ToString()
End If
ik2 = imga.href.ToString()


Next
i += 1



It returns the ordinary images in that page. But ad's <img> tag doesn't read.

Because ad's mostly inside the iframe or embed or object tags.

How can i get the <img tag with in the iframe or object,embed tags ?

Thanks for your response.
Posted 13 Sep, 2010 05:59:55 Top
Andrei Smolin


Add-in Express team


Posts: 14210
Joined: 2006-05-11
Hi Aswathi,

Let's continue the topic on the following page: How to get image tag and anchor tags attributes from iframe tags using C#.Net with add in express tool

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Sep, 2010 08:34:36 Top