.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 27th, 2012, 09:43 AM
eurusd eurusd is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 5 eurusd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 6 sec
Reputation Power: 0
Red face VB.Net WebBrowser Control Ajax Click Value Getting Problem

VB.Net WebBrowser Control Ajax Click Value Getting Problem

Code:
<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
	Wicket.Event.add(window, "load", function(event) { $("#iconContainer6").click(function(){Plimus.web.ui.openNewWindow('(URL address blocked: See forum rules));});});
	/*-->]]>*/</script>
	
	<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
…..
<div class="item-name-icon tooltip-marker " id="itemUrlIcon3a"> 
<div id="iconContainer6" class="ui-state-default ui-corner-all ui-button-fade"><span class="ui-icon ui-icon-extlink"></span></div> </div>

How can I get value = '(URL address blocked: See forum rules) from div id="iconContainer6" 
I am using VB.net and webbrowser control and webbrowser1.documenttext + regexp works

        Dim matches As MatchCollection = Regex.Matches(ie.DocumentText.ToString, "openNewWindow\('.*'\)", RegexOptions.IgnoreCase)
        dbg(matches.Count.ToString)
        Dim tmp As String

        If matches.Count > 0 Then
            For i = 0 To matches.Count - 1
                ' dbg(matches.Item(i).ToString)
                tmp = Replace(matches.Item(i).ToString, "openNewWindow('", "")
                tmp = Replace(tmp, "')", "")

                mem += vbCrLf & tmp

            Next
            dbg(mem)

but it works only first time when document completed, Then it is not refreshing because of AJAX dynamic load
I am trying javascript but failing to get values from onClick

        Dim head As HtmlElement = ie.Document.GetElementsByTagName("head")(0)
        Dim scriptel As HtmlElement = ie.Document.CreateElement("script")
        Dim element As IHTMLScriptElement = scriptel.DomElement
        '//alert(document.body.innerText);alert(x.length);
        element.text = "function getlink(){var x=document.getElementsByTagName('div');"
        element.text &= "var divs='';for (i=0;i<x.length;i++){var s=document.getElementsByTagName('div')[i].getAttribute('id'); if (s!=null){if(s.indexOf('iconContainer') > -1){divs+='\n'+s;for (z=0;z<document.getElementsByTagName('div')[i].attributes.length;z++){var ss=document.getElementsByTagName('div')[i].attributes[z].name;if(ss.indexOf('onclick')>-1){divs+=document.getElementsByTagName('div')[i].attributes[z].firstChild.data}}; break}}} alert(divs);"

        element.text &= ""
        element.text &= ""
        element.text &= ""
        element.text &= "}"
        head.AppendChild(scriptel)
        ie.Document.InvokeScript("getlink")


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > VB.Net WebBrowser Control Ajax Click Value Getting Problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap