|
-
Feb 27th, 2011, 09:33 AM
#1
Thread Starter
Lively Member
[RESOLVED] extract a "value" from html tag or a textbox
Hi,
Please help me do something.
The full story is very very long, but the bottom line is:
I'm reading html tags from a webpage using Webbrowser and HtmlElementCollection class. Then I invoke specific members (link, buttons etc.) depending on their attributes.
I got stuck at one point. The webpage has many similar images in one place. They can be distinguished only but a version number. I need to get this number somehow to be able to invoke the correct link/image.
this is the example of the html code (it looks like that - I only removed personal imformation from it) - lets say I got it already saved in a textbox:
Code:
<TR>
<TD>My text for label</TD>
<TD>my text for description</TD>
<TD>27 February 2011 12:12</TD>
<TD>my username</TD>
<TD>197</TD>
<TD> </TD>
<TD><NOBR><A id=snapshot_revert_cms-company-3 onclick="document.forms['website']['website:act'].value='website:snapshot_revert_cms-company-3';document.forms['website']['sandbox'].value='cms-company-3';document.forms['website']['version'].value='197';document.forms['website'].submit();return false;" href="#"><IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VERTICAL-ALIGN: -4px; BORDER-LEFT-WIDTH: 0px" title=Revert alt=Revert src="/servertype/images/icons/revert.gif"></A> <A id=snapshot_deploy_cms-company-3 onclick="document.forms['website']['website:act'].value='website:snapshot_deploy_cms-company-3';document.forms['website']['store'].value='cms-company-3';document.forms['website']['version'].value='197';document.forms['website'].submit();return false;" href="#"><IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VERTICAL-ALIGN: -4px; BORDER-LEFT-WIDTH: 0px" title=Deploy alt=Deploy src="/servertype/images/icons/deploy.gif"></A> <A id=snapshot_compare_to_previous_cms-company-3 onclick="document.forms['website']['website:act'].value='website:snapshot_compare_to_previous_cms-company-3';document.forms['website']['sandbox'].value='cms-company-3';document.forms['website']['version'].value='197';document.forms['website'].submit();return false;" href="#"><IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VERTICAL-ALIGN: -4px; BORDER-LEFT-WIDTH: 0px" title="Compare to Previous Snapshot" alt="Compare to Previous Snapshot" src="/servertype/images/icons/comparetoprevious.png"></A> <A id=snapshot_compare_to_any_cms-company-3 onclick="document.forms['website']['website:act'].value='website:snapshot_compare_to_any_cms-company-3';document.forms['website']['sandbox'].value='cms-company-3';document.forms['website']['version'].value='197';document.forms['website'].submit();return false;" href="#"><IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VERTICAL-ALIGN: -4px; BORDER-LEFT-WIDTH: 0px" title="Compare to Any Snapshot" alt="Compare to Any Snapshot" src="/servertype/images/icons/comparetoany.png"></A></NOBR></TD></TR></TBODY></TABLE></DIV></TD></TR>
Now - I'm after the number 197 which appears couple of times in the code.
I know what is the 'My text for label', 'my text for description' and 'my username'. Also those 3 links in form of images have always the same structure, apart from the number in question - number 197.
How do I extract the 197 number alone ?
If I would get it, I would use it to identify the link with ID: "id=snapshot_deploy_cms-company-3" and invoke it.
Basically I want to do this:
If a TR tag contains 'My text for label' and also contains 'my username', then
read the number 197
and... say... save the number into a textbox.
Last edited by marl; Feb 27th, 2011 at 09:40 AM.
Reason: removed some personal info
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|