Hi Guys
I was just wondering if anybody can help me with a problem i have been having. Basically what i am trying to do is grab an element off a WebPage by it's class name and make Vb automatically look up to see if there is a number greater than with in the element. I have the html code below.
<div class="tix_limit_num">0</div>
Any suggestions here guys.
Thank You In Advance.
9 Replies - 1200 Views - Last Post: 29 June 2012 - 09:06 AM
#1
How to grab an element by it class, and saying if it contains a number
Posted 27 June 2012 - 11:58 AM
Replies To: How to grab an element by it class, and saying if it contains a number
#2
Re: How to grab an element by it class, and saying if it contains a number
Posted 27 June 2012 - 01:09 PM
any suggestions
#3
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 06:41 AM
any ideas
#4
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 08:53 AM
Yes. Grab the HtmlElements of your HTMLDocument, grab by tag name "div" and find the text you need.
Something along the lines of this. I suggest exploring the html objects of the .net framework. MSDN is useful.
For Each y As HtmlElement In WebBrowser1.document.GetElementsByTagName("div")
ListBox1.Items.Add(y.InnerText)
Next
Something along the lines of this. I suggest exploring the html objects of the .net framework. MSDN is useful.
#5
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 09:06 AM
may i ask why there is a listbox that is not what i am wanting to use. I am wanting to grab and element by it's class and say if it contains a number then do something
Picture below (what the html is)
Picture below (what the html is)
#6
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 09:45 AM
No you may not ask. I'm not doing your work for you. I gave you an example to start you off, if you want code hand outs go somewhere else. Looks to me like you've done zero work for yourself, I googled and found many articles in no time whatsoever and the pace at which you post on your own thread shows that you are just waiting for others to do your work.
#7
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 10:25 AM
i thought, this is what forums was for, is to help people work out codes for things and learn. So can anybody help with this. I know how to get it by id, but i am wanting. the code to be similar to
if classname = "mam_limit_num") and contains an integer >0
then do something
if classname = "mam_limit_num") and contains an integer >0
then do something
#8
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 10:27 AM
The forum is here to help people who have clearly done their own work, and need a helping hand on code they have worked on. You've no demonstrated any of that. You've just said "this Is what I want now give it to me".
#9
Re: How to grab an element by it class, and saying if it contains a number
Posted 28 June 2012 - 10:30 AM
no, sorry, ok then i did do research. i found this a while ago but. i don't know how to modify this it to something i am trying to do.
Any ideas, how to modify this. It will help a lot please.
Dim PageElement As HtmlElementCollection = Form2.WebBrowser1.document.GetElementsByTagName("div")
For Each CurElement As HtmlElement In PageElement
'ListBox1.Items.Add(CurElement.GetAttribute("className").ToString())
If (CurElement.GetAttribute("className") = "playline") Then
TextBox1.Text = CurElement.GetAttribute("id")
End If
Next
Any ideas, how to modify this. It will help a lot please.
#10
Re: How to grab an element by it class, and saying if it contains a number
Posted 29 June 2012 - 09:06 AM
any suggestions
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|