diff --git a/NewLife.Spider/BaseSpider.cs b/NewLife.Spider/BaseSpider.cs
index d9e44d3..219b771 100644
--- a/NewLife.Spider/BaseSpider.cs
+++ b/NewLife.Spider/BaseSpider.cs
@@ -26,13 +26,6 @@ public abstract class BaseSpider
browser.RequestHandler = _handler;
}
- private static async Task<String> GetProxyServer()
- {
- var str = await _httpClient.GetStringAsync("http://674246494.user.xiecaiyun.com/api/proxies?action=getText&key=NP980F72F7&count=1&word=&rand=true&norepeat=false&detail=false<ime=0");
- if (String.IsNullOrWhiteSpace(str)) throw new Exception("代理服务器获取失败");
- return $"http://{str}".Trim();
- }
-
/// <summary></summary>
/// <returns></returns>
/// <exception cref="Exception"></exception>
@@ -50,33 +43,13 @@ public abstract class BaseSpider
isDone = true;
}
}
-
using (CefResourceRequestHandler.CaptureAjax(handler))
{
- if (_changeProxy)
- {
- _changeProxy = false;
-
- var proxy = await GetProxyServer();
-
- await Cef.UIThreadTaskFactory.StartNew(delegate
- {
- var rc = browser.GetBrowser().GetHost().RequestContext; //获取 Request 上下文
- var dict = new Dictionary<String, Object> { { "mode", "fixed_servers" }, { "server", proxy } };
-
- if (!rc.SetPreference("proxy", dict, out var error))
- throw new Exception(error);
- });
- }
-
await browser.LoadUrlAsync(desUrl);
-
await Task.Delay(delayms);
-
//TODO:可能有其他操作JS的任务
OtherOperate();
}
-
if (!isDone) XTrace.WriteLine($"没有获取到数据");
}