Now before posting this question i did read...
How to select a class by GetElementByClass and click on it programmically
But this doesn't work for me. Apparently I'm an idiot and don't know how to use that code, or its just not working for me. I also am using the WebBrowser Control in VB.NET if that helps at all...
I have the following I'm trying to click...
<div class="closewindow"></div>
Now of course this is buried below and inside tons and tons of other divs, but it doesn't have any direct "owner". There is no or anything like that. Its just sitting by itself
Here is the html its barried in
<div class="main_class">
<div id="FullItemView">
<div style="width: 90%; float: left;">
<div class="headline">
<table style="width: 100%;">
<tbody><tr>
<td style="width: 15%; text-align: right; vertical-align: middle;">
<img class="switchImage" src="pictures/pic.png"></td>
<td style="width: 70%; vertical-align: middle;">
<span class="ListItemTitle">Renegade</span></td>
<td style="width: 15%; text-align: left;">
<img class="switchImage" src="pictures/pic.png"></td> </tr> </tbody></table>
</div>
</div>
<div class="closeWindow"></div>
......
Now I just want to be able to single out the and then invoke a "click" on this div and this div only. I know when its being clicked because of some PHP code thats on the server, but that would take too long to explain how that works.
Anyone know how i can single this out so when i have a variable XITEM or something inside .NET then i can invoke it? Like if I had ...
For XITEM as HTMLELEMENT in WebBrowser1.Document.GetElementsByTagName("div")
......
item.invokeMember("click")
.....
Then it clicks only the HTMLELEMENT "chosen". Hopefully this makes sense to everyone
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…