• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 461
  • Last Modified:

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

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

0
66chawger
Asked:
66chawger
  • 2
1 Solution
 
Bob LearnedCommented:
Can you use document.getElementsByTagName or document.getElementById?

Bob
0
 
66chawgerAuthor Commented:
Bob, what I was originally doing above was correct, the code was just in the wrong place and wasn't being called.
0
 
Bob LearnedCommented:
If your happy, I'm happy.

Bob
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now