示例#1
0
 public RootTemp CreateXmlDocument(SearchInputService input)
 {
     //CookieCollection c= crawlerHelper.getCookieCollection(adress, "POST", getPostData(input));
     HtmlDocument d = crawlerHelper.getDocument(address, "POST", getPostData(input), null);
     RootTemp rootxml = new RootTemp();
     rootxml.Departure = input.DepartureCode;
     rootxml.Arrival = input.ArrivalCode;
     rootxml.AirLine = AirLineName.tiger;
     rootxml.blocks = new List<Block>();
     rootxml.AirLine = AirLineName.tiger;
     Block b = new Block();
     HtmlNode node = d.DocumentNode.SelectSingleNode("//div[contains(@class,'depart-flight')]");
     b.outBound = getOutInBound(node);
     node = d.DocumentNode.SelectSingleNode("//div[contains(@class,'return-flight')]");
     b.inBound = getOutInBound(node);
     rootxml.blocks.Add(b);
     return rootxml;
 }
示例#2
0
 public RootTemp CreateXmlDocument(SearchInputService input)
 {
     //CookieCollection c= crawlerHelper.getCookieCollection(adress, "POST", getPostData(input));
     _input = input;
     string posdata = getPostData(input);
     HtmlDocument d = crawlerHelper.getDocument(address, "POST", posdata, null);
     ////debug
     //File.WriteAllText("D:p.html", d.DocumentNode.InnerHtml);
     RootTemp rootxml = new RootTemp();
     rootxml.Departure = input.DepartureCode;
     rootxml.Arrival = input.ArrivalCode;
     rootxml.blocks = new List<Block>();
     rootxml.AirLine = AirLineName.airAsia;
     Block b = new Block();
     HtmlNode node = d.DocumentNode.SelectSingleNode("//div[@id='availabilityInputContent1']/div[@class='depart-section']");
     b.outBound = getOutInBound(node,true);
     node = d.DocumentNode.SelectSingleNode("//div[@id='availabilityInputContent2']/div[@class='depart-section']");
     b.inBound = getOutInBound(node,false);
     rootxml.blocks.Add(b);
     return rootxml;
 }