var ele = (
from T in webBrowser1.Document.GetElementsByTagName("div").Cast<HtmlElement>()
where T.GetAttribute("classname") == "ball ball-1"
select T).FirstOrDefault();
Hey, im trying to make a simple csgodouble bot, with a ui. I want to get some data from a website called, csgodouble. but i have came into a problem.
div data-rollid="310835" class="ball ball-1">1 /div
html element.
but there are 10 lines there look like that, with very small different, and they change each minute or so. how can you only get the data from the 10th line??
have tried to use the code above, but it will read all the 10th line.
i know xpath, will provide you to only get data from 10th line. but have no clue how to use it, to get that data in my application. i use the windowsapplication project in visual studio.
//*[@id="past"]/div[10] xpath code.
i have searched all over google for help, cant seem to find anything!
If have know how to fix it, and will help. please say what you have done, and why. so i can get a better understanding of c# and code in general.
update to the question d 5/18-2016 - 9:51
http:
Hey here can you see my code, and the source code from csgodouble.
I have tried everything to get the 10th line information.
have tried ElementAtOrDefault(9); at 10, instead of 9.. but doesnt seem to work
the data-rollid change every time a new number comes in.
i want to get output, if it was red, black or green there won.
the last line in the source code, is color that won
ball ball-1 = red
ball ball-8 = black
ball ball-0 = green</pre>
What I have tried:
var ele = (
from T in webBrowser1.Document.GetElementsByTagName("div").Cast<HtmlElement>()
where T.GetAttribute("classname") == "ball ball-1[10]"
select T).FirstOrDefault();
And other simpler code, but i have delete them. tried a little bit of xpath. but not much.