| | |
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 |
.net .net2008 2005 2008 access account array basic beginner bing browser button buttons center check checkbox client code convert crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist eclipse excel fade filter forms ftp generatetags gridview html images inline input insert intel internet listview mobile monitor net objects open panel passingparameters pdf picturebox port position print printing problem read remove save searchbox searchvb.net select serial settings shutdown soap sqlserver survey table tcp temperature textbox timer timespan transparency trim update user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year






