Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Capture / Modify Webbrowser1 source before rendering to screen

Avatar of friskyweasel
friskyweasel asked on
C#
6 Comments1 Solution323 ViewsLast Modified:
hello all -
using webbrowser1 i navigate to a web site in which there is a known table from which i want to read (and in this case write/modify) some data

i'm currently looping thru all the elements in the target table something like
   foreach(row in the table)
    {
      foreach(cell in the current row)
       {
         
       }
    }

for each cell that i encounter, this particular page has multiple HTML tags (<div>value1</div><span><div>value 2</div></span>, etc....)

my question is 2 part:
1) when my most inner loop (foreach(cell in the row)) is currently on a specific cell, how can i then do yet another loop thru each HTML tag that's contained in that cell and ordinally reference the innertext of it?

2) how can i modify the properties of one of the given HTML tags inside that cell entry? for instance, if this is the HTML that falls in the cell (within the <td></td> tags for that table cell)

<div>value1</div>
<span>
 <div>value 2</div>
</span>
<a href='http://www.google.com'>google</a>


how could i change the HTML source of the <a href tag to read:
<a href='http://www.google.com' class='MyOwnClass'>google12345</a>

and have that be the <a href that shows when i view the source of the resulting page? Right now i'm experimenting and seem to be able to change some properties of the <a href tag, but when i view the source of the fully loaded page, the <a href tag's syntax hasn't changed at all
ASKER CERTIFIED SOLUTION
Avatar of Joni Kettunen
Joni KettunenFlag of Finland imageSenior Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers