![]() |
| ||
| Screen Scrape remove spaces/line breaks between specified tags 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 <li class="thisclass"> I can't to a simple replace because of all the spaces. So I need to get it to look like this <li class="thisclass">TheText</li> Any ideas how I might do this? Thanks in advance |
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Hi, you specify, what method you are using to Scrape the Page . Have you heard Regex class? |
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Hi, This is the method I used:- http://www.dotnetjohn.com/articles.aspx?articleid=93 Not heard of that class |
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags 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 |
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Quote:
|
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Ever heard of Trim(). Use it! |
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Quote:
|
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Incorrect, trim does replace line breaks and spaces. Please prove me wrong but you won't. I have just tested it: Dim nl As String = System.Environment.NewLine |
| ||
| Re: Screen Scrape remove spaces/line breaks between specified tags Quote:
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 . |
| All times are GMT -4. The time now is 4:59 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC