Link to home
Start Free TrialLog in
Avatar of Noero
Noero

asked on

use webbrowser to reach a link in a table

Hello guys,

I am currently on a Csharp project wich retrieves datas from website. in order to navigate I am used to use webBrowser.Document.GetElementByID(Idresearched) method. But in a certain html page I am pretty lost;

with html pages with button I can reach them with GetElementByID or Invoke them with GetElementByType method, but in this case there is no button just a table of link. The table does not have id.

I want to reach APD's with href="apdreportsmenu.cfm?Skip='Y'&oops=#oops#" which opens the page I am interested into.

I should be so happy to get some clue for accessing it!

Thanks in advance!




<html>


<LINK rel="stylesheet" type="text/css" href="uhonon.css">

<body style="margin-left:12%;">



<table border="0" width=90% cellpadding="10" height="90%" align="center" >

<tr><td colspan="1" width="33%" align="left"  bgcolor="white" >

<table border="0" width=100% cellpadding="1" height="100%" align="right" >

<tr><td align="left" nowrap height="10"><a href="AdminChoice2Menu.cfm?Skip='Y'&oops=#oops#" target="_top" ><b>Appls</b></a></td></tr>

<tr><td align="left" nowrap height="10"><a href="A2Menu.cfm" ><b>AOR</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="BLMTREE2.cfm?Skip='Y'&oops=#oops#&RequestTimeout=3500" target="_top" ><b>Ag</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="apdreportsmenu.cfm?Skip='Y'&oops=#oops#" target="_top" ><b>APD's</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="BasinsMenu.cfm?Skip='Y'&oops=#oops#"  target="_top" > <b>Basb</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="cbMenu.cfm?Skip='Y'&oops=#oops#" target="_top" ><b>CB</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="ScompcompMenu.cfm?Skip='Y'&oops=#oops#" target="_top" ><b>Comp</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="coMenu.cfm?Skip='Y'&oops=#oops#"  target="_top"  ><b>Cor </a></td></tr>

<tr><td align="left" nowrap height="10"><a href="couMenu.cfm?Oops=#oops#&Skip='Y'&oops=#oops#"  target="_top"   ><b>Cou</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="urecordsMenu.cfm?Skip='Y'&oops=#oops#"  target="_top"  ><b>Down Load</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="Electronicfilingmenu.cfm" target="_top" ><b>Electronic Filing</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="craig/craigie.html?Skip='Y'&oops=#oops#"  target="_top"  ><b>Envir</a></td></tr>

<tr><td align="left" nowrap height="10"><a href="FMenuNew.cfm"><b>Field</b></a></td>

</table>

</td>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Noero
Noero

ASKER

It looks that the program doesn't come into the foreach loop. Nevertheless, Thank for your help!
Is that the complete HTML that you posted? Perhaps it is hosted in a page that has a frame?
Avatar of Noero

ASKER

Indeed, the table is in a frame named Menu Frame, could you say me what function I should use to specify webbrowser to access to table?
Avatar of Noero

ASKER

Well, i figured it  out ->

this.webBrowser_Main.Document.Window.Frames["NameOfFrame"].Document.GetElementsByTagName("a")

Thank you very much kaufmed!
NP. Sorry I didn't get back to you on your later question. Glad you figured it out though   = )