Sign in to follow this  
Followers 0
saeed88

Tag exist in web page

8 posts in this topic

hello guys

I need a code tell you the tag exist or not .

Share this post


Link to post
Share on other sites



yes I Know this code , but I want to check if a tag is exist or not . if not exist tell me "Not exist"

Share this post


Link to post
Share on other sites

Dear John please tell me how to return the exist or not , yes sure :)

Share this post


Link to post
Share on other sites

I see this is the second question you have had without even trying anything.

Lets hop the third time is the charm eh!

#include <IE.au3>
Local $oIE = _IE_Example("basic")
Local $oElements = _IETagNameAllGetCollection($oIE)
For $oElement In $oElements
If $oElement.tagname = "tag" Then
  MsgBox(0,0,"Woohoo")
  Exit
EndIf
Next

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#include <IE.au3>

Local $oElements = _IETagNameAllGetCollection($oIE)
Local $tagImlookingfor = "whataPain"
For $oElement In $oElements
If $oElement.tagname = $tagImlookingfor Then
  MsgBox(0, "Element Info", "Tag " & $tagImlookingfor & ": " & $oElement.tagname & @CR & "contains innerText: " & $oElement.innerText)
Else
  MsgBox(0, "NOT FOUND", "Tagname: " & $oElement.tagname & @CR & "was not found !")
EndIf
Next

Share this post


Link to post
Share on other sites

works fine.

thanks for your help..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0