We help IT Professionals succeed at work.

How to scrape check box from a site and value as checked

66chawger
66chawger asked
on
I am scraping a client's site and rendering their screens through my user control (scraping).  At the end I have the need to value a check box as checked so I can proceed to render a button which creates a report.  Look at my code snippet below to see what I have done so far.
--the following gets finds the button "btnPrint" and renders it as clicked.  This works fine.
IHTMLElement InputUsrID = (IHTMLElement) doctitle.GetAll().Item("btnPrint",0);
InputUsrID.Click();
 
-- the following is like above, but this time it is a check box and I need to find it as well as value it as checked.  I am not sure about the syntax for the checkbox and if it is the same as I have done above
 
IHTMLElement InputUsrID = (IHTMLElement) doctitle.GetAll().Item("PolicyReportsQuoteSummary",0);
InputUsrID.Click();

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
Can you use document.getElementsByTagName or document.getElementById?

Bob
Bob, what I was originally doing above was correct, the code was just in the wrong place and wasn't being called.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
If your happy, I'm happy.

Bob