5 Replies - 4965 Views - Last Post: 07 July 2009 - 11:26 PM Rate Topic: -----

#1 mishipal  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 88
  • Joined: 04-May 09

Get value of text from webpage

Posted 06 June 2009 - 09:51 PM

how can we get value of text from webpage.

the html is
<form name=netcustomer method="POST"> 
 
			
				<tr> 
					 <td width="60%"> 
						  <div align="left"><font face="arial" size="2"><b>Current Corporate Balance Summary: </b></font></div> 
						</td> 
						<td width="30%"> 
						  <div align="left"><font face="arial" size="2"> 
						  </font></div> 
						</td> 
				</tr> 
				  <tr> 
 
						<td width = "30%" > 
						  <div align="left"><font face="arial" size="2">CMS Balance: 210623.93 </font></div><!-- sudheer --> 
						</td> 
						<td width = "30%"> 
						  <div align="left"><font face="arial" size="2">Petromiles Balance: 9049559 </font></div> 
						</td> 
						 <td width="30%"> 
						  <div align="left"><font face="arial" size="2"> 
						  </font></div> 
						</td> <br> <br> <br> 
							<input type="hidden" name="hFO" value="FO"> 
						</tr> 
					 </td> 
						 </tr> 
						 
 
	<!-- form1 --> 


i want to extract CMS BALANCE thing

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Get value of text from webpage

#2 Cookiesliyr  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 136
  • Joined: 16-May 09

Re: Get value of text from webpage

Posted 07 June 2009 - 02:10 AM

to be frank i am not that good to help u in net problems but try to find the solutions in HTML or XHTML stuff
Was This Post Helpful? 0
  • +
  • -

#3 SenHu  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 26-December 08

Re: Get value of text from webpage

Posted 06 July 2009 - 10:57 AM

You want to extract the amount from "CMS Balance: 210623.93 " on the web page. I will assume your page is at URL http : // www.xxx.yyy/page.html . (Make sure you use the correct URL when testing.) Here is the script.

# Script CMSBalance.txt
var str URL; set $URL="http://www.xxx.yyy/page.html"
var str page; cat $URL > $page
# Remove everything upto and including "CMS Balance: ".
stex "^CMS Balance: ^]" $page > null
# Remove everything after and beginning with the next space.
stex "[^ ^" $page > null
# $page now has just the amount.
# (Convert it to real number with makereal() function if necessary.)
echo $page





Script is in biterscripting. To use,

1. Install biterscripting from http://www.biterscripting.com.
2. Save the above script in file C:\Scripts\CMSBalance.txt.
3. Start biterscripting, run the script by entering the following command.

script CMSBalance.txt

You should see the amount. It is that simple. (As I mentioned, make sure you set the value of $URL to the correct URL.)

If you enhance this script, please post it back here for the benefit of others. If you need help, email me.

Sen
Was This Post Helpful? 0
  • +
  • -

#4 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Get value of text from webpage

Posted 06 July 2009 - 11:04 PM

Just to make sure, are you using VB.NET?

---

Can we see the code that you're working on :) Thanks.
Was This Post Helpful? 0
  • +
  • -

#5 mishipal  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 88
  • Joined: 04-May 09

Re: Get value of text from webpage

Posted 07 July 2009 - 12:03 AM

I figured that out many days ago...thanks for your replies

For Each element As HtmlElement In Me.WebBrowser1.document.All
			   If element.TagName() = "DIV" Then
				  If element.InnerText.StartsWith("CMS") Then
					 Progress.Text = "Current Online Balances:"
					 CmsLab.Text = element.InnerText
					 CmsLab.Visible = True
				  Else
					 If element.InnerText.StartsWith("Petro") Then
						PetroLab.Text = element.InnerText
						PetroLab.Visible = True
					 End If
				  End If
			   End If
			Next


Was This Post Helpful? 0
  • +
  • -

#6 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Get value of text from webpage

Posted 07 July 2009 - 11:26 PM

That seems like VB.NET. Have a check of the compiler before posting :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1