Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i dont know how to fix this.. thanks!!

woodproduction is my variable.
wb is my web browser.
l1 is the ID of a value.
value is the value of l1.
woodprodval is a label i wish to place the value of l1.
l1 is a number. it changes every hour.
when a user clicks the refresh button this script will run and try to load that l1 number into the label's text..

HtmlElement woodproduction = wb.Document.All["l1"];
     woodproduction.GetAttribute("value ");
     woodprodval.Text = (woodproduction);

Cannot implicitly convert type 'System.Windows.Forms.HtmlElement' to 'string'.

the page's line of HTML looks like this:

<span id="l1" class="value ">444/1200</span>

and the page visible to my eye is:

444/1200

the current number is 444. that is the number i am in need of fetching.
Posted
Updated 7-Jun-11 22:05pm
v4

1 solution

Try using woodprodval.Text = woodproduction.InnerText;
 
Share this answer
 
Comments
vlad781 8-Jun-11 4:26am    
I LOVE YOU I WAS LOOKING FOR THIS ALL DAY!!!!!!!!!!!
walterhevedeich 8-Jun-11 4:32am    
If this was your way of saying thank you, then your'e welcome. :)
vlad781 8-Jun-11 4:59am    
lol ya, thanks. you have no idea, i was going crazy here..
walterhevedeich 8-Jun-11 9:39am    
Im glad I helped. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900