根据特定父级获取子节点
var coord = "(51.01407864998378, 4.15557861328125)";
Match match = Regex.Match(coord, @"\(([\d]*.[\d]*),[^\d]*([\d]*.[\d]*)\)$", RegexOptions.IgnoreCase);
if (match.Success)
{
decimal lng = Convert.ToDecimal(match.Groups[1].Value, CultureInfo.GetCultureInfo("en-US"));
decimal lat = Convert.ToDecimal(match.Groups[2].Value, CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine(lng);
Console.WriteLine(lat);
}
如何让function(Crawler $node,){
$node->filter('this>ul');
}
个孩子不包含像CSS选择器$node
这样的孙子?
答案 0 :(得分:2)
this
或parent
选择器。$node->filter('>ul');