Commit 9122ba74 authored by 黄奎's avatar 黄奎

爬虫修改

parent 9cc7a8e0
......@@ -435,7 +435,23 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
var pItem = jItem.ToObject<JObject>();
string dateStr= pItem["date"].ToString();
string newDateStr= dateStr.Substring(0,4)+"-" + dateStr.Substring(4, 2)+"-"+dateStr.Substring(6, 2);
decimal.TryParse(pItem["b2cPrice"].ToString(), out decimal b2cPrice);
decimal b2cPrice = 0;
try
{
if (pItem.ContainsKey("b2cPrice"))
{
decimal.TryParse(pItem["b2cPrice"].ToString(), out b2cPrice);
}
if (pItem.ContainsKey("price"))
{
decimal.TryParse(pItem["price"].ToString(), out b2cPrice);
}
}
catch (Exception ex)
{
}
if (b2cPrice <= 0)
{
b2cPrice = item.B2CPrice;
......
......@@ -62,6 +62,7 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
{
AddDataFlow(new ListParser());
List<Request> requests = new List<Request>();
SouthEastRequest.TotalPage = 2;
for (int i = 1; i <= SouthEastRequest.TotalPage; i++)
{
var request = new Request(SouthEastRequest.URL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment