| | |
Screen Scrape remove spaces/line breaks between specified tags
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I'm doing a screen scrape of a web page, which works with out any problems
What I want to do is replace the contents of tag, I can do this if the tag match exactly but in this page there are allot of blank spaces.
lbltest.Text contains the page being scrapped. The tag is formatted like this
I can't to a simple replace because of all the spaces. So I need to get it to look like this
Any ideas how I might do this?
Thanks in advance
I'm doing a screen scrape of a web page, which works with out any problems
What I want to do is replace the contents of tag, I can do this if the tag match exactly but in this page there are allot of blank spaces.
lbltest.Text contains the page being scrapped. The tag is formatted like this
VB.NET Syntax (Toggle Plain Text)
<li class="thisclass"> TheText </li>
I can't to a simple replace because of all the spaces. So I need to get it to look like this
VB.NET Syntax (Toggle Plain Text)
<li class="thisclass">TheText</li>
Any ideas how I might do this?
Thanks in advance
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
Hi,
This is the method I used:-
http://www.dotnetjohn.com/articles.aspx?articleid=93
Not heard of that class
This is the method I used:-
http://www.dotnetjohn.com/articles.aspx?articleid=93
Not heard of that class
Regex is a Class that used for Regular Expressions. It is useful for Parsing.
For more detail, refer http://www.regular-expressions.info/dotnet.html
For more detail, refer http://www.regular-expressions.info/dotnet.html
KSG
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
Regex is a Class that used for Regular Expressions. It is useful for Parsing.
For more detail, refer http://www.regular-expressions.info/dotnet.html
Incorrect, trim does replace line breaks and spaces. Please prove me wrong but you won't.
I have just tested it:
I have just tested it:
VB.NET Syntax (Toggle Plain Text)
Dim nl As String = System.Environment.NewLine Dim test As String = " " + nl + nl + " TheText " + nl + nl TextBox1.Text = test 'show original string in a multiline text box TextBox2.Text = test.Trim 'show changed string in a multiline text box
Last edited by iamthwee; Aug 26th, 2008 at 10:22 am.
*Voted best profile in the world*
•
•
•
•
thanks, how would I pick up on the line breaks and spaces, would it be possile to show me an example?
Please google it for parsing HTML using Regex class. You will get a lot. Once you can able to parse HTML Tags, Ultimately you have to Use String.Trim() to remove unwanted white spaces .
KSG
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Unable to create an excel file in VB.net
- Next Thread: 2 Questions from a student
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add advanced application array assignment basic binary box button buttons center click code combo connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall folder image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity pan peertopeervideostreaming picturebox picturebox2 plugin port print printpreview record regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic visualbasic.net web winsock wpf xml






