Menu

require help with ClientProperties

Help
Rurouni
2005-08-16
2013-04-26
  • Rurouni

    Rurouni - 2005-08-16

    a site i'm going to uses a sniffer to detect that the http unit is neither an IE browswer or Netscape browser.  i'm having trouble setting httpunit to trick the site in thinking its IE browsing the site

    i tried to do the following:

    ClientProperties cp = wc.getClientProperties();
    cp.setApplicationName( "Microsoft Internet Explorer" );
    cp.setApplicationVersion( "5.5" );
    cp.setUserAgent( "Microsoft Internet Explorer 5.5" );

    but it's not working

    any suggestions would be very much appreciated

    thank u

     
    • Rurouni

      Rurouni - 2005-08-18

      nevermind, i found a solution, what i did was:

      short nodeType = node.getNodeType();
      else if( nodeType == Node.ELEMENT_NODE )
                   {
                       if( dataObject.parcelMap.equals( "" ) )
                       {
                           String nodeName = node.getNodeName();
                          
                           if( nodeName.equalsIgnoreCase( "input" ) )
                           {
                               NamedNodeMap attrList = node.getAttributes();
                               int a = attrList.getLength();
                               Node attrNameNode = attrList.getNamedItem( "name" );
                              
                               if( attrNameNode != null )
                               {
                                   String attrNameValue = attrNameNode.getNodeValue().trim();
                                  
                                   if( attrNameValue.equalsIgnoreCase( "img" ) )
                                   {
                                       Node attrSrcNode = attrList.getNamedItem( "src" );
                                       String attrSrcValue = attrSrcNode.getNodeValue().trim();
                                      
                                       dataObject.parcelMap = "<IMG CLASS=\"imageborder\" SRC=\"http://64.234.218.210" + attrSrcValue + "\" HEIGHT=\"360\" WIDTH=\"488\">";
                                   }
                               }
                           }
                       }
                   }

       
    • Rurouni

      Rurouni - 2005-08-18

      Oooops, wrong right solution but for wrong positing, my bad

       

Log in to post a comment.

MongoDB Logo MongoDB