| | |
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
Selva •
•
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 .
Selva ![]() |
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 |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters picturebox picturebox1 plugin port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf






