HTML Page parsing fails with certain Tag

2 posts, 1 answers
  1. Roman
    Roman avatar
    1 posts
    Member since:
    Aug 2011

    Posted 20 Oct 2011 Link to this post


    I just found an odd example where a Page cannot be parsed correctly and therefore, the Find.ByXXX fails with an exception!

    Here's a very simple html of a page which fails:
            Hello<b. xmlns="">World</b.>

    I know that this is an invalid Tag but shouldn't it be ignored instead of leading to exceptions when using the browser object?

    Here's the C# code which leads to the exception:
    Manager myManager = new Manager(false);
    Browser browser = myManager.ActiveBrowser;
    Find finder = browser.Find;
    string findPath = @"//li[@id='tab_CarsAndBikesTechnicalDetails1']/a";
    Element foundElement = finder.ByName(findPath) ?? finder.ById(findPath);

    And here's the exception I get:
    Find Details:
    - FindParam used: [Find logic: Use 'AttributesOnly' where (name=//li[@id='tab_CarsAndBikesTechnicalDetails1']/a) ]
    - Start Element: [Element: '#text#:-1']
    and the Inner exception is:
    Start reference has to be a valid element and not an EndTag
    Parameter name: Reference

    Is there any possibility that such an invalid tag is ignored instead of leading to such exceptions?

    Thanks for Help
  2. Answer
    Stoich avatar
    1 posts

    Posted 25 Oct 2011 Link to this post

    Hi Roman,
          thank you for your feedback on this. I've managed to reproduce this and I've logged it as a bug:
    500 Telerik points added to your account.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top