-1

So basically I want to press a button in a website and i dont know what code to use. The HTML line looks like this:

<a href="#" class="Free" data-date="1498544574">Click Here</a>

I want the program to click on that Free Button using DOM. I tried this :

webBrowser1.Document.GetElementByClassName("free").InvokeMember("click");

But for some reason the GetElementByClassName is highlighted (in visual studio 2015)

I cannot change the HTML since the website is not mine.

patata fun
  • 11
  • 3

1 Answers1

0

It's highlighted cause there is no function GetElementByClassName in WebBrowser.Document!

Look at this, maybe it would help you:

How to select a class by GetElementByClass and click on it programmically

GreenEyedAndy
  • 1,485
  • 1
  • 14
  • 31