- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我希望从我通过代码创建的 URL 下载 Google 趋势数据。当将这些 URL 放入浏览器(我使用 firefox)时,会显示一个保存提示,我可以在通过浏览器查看时选择打开或保存文件。但是,我希望通过代码获得包含 Google 趋势数据的同一个 .csv 文件,但我被卡住了。
这是我的代码创建的链接之一:[是否提示下载,但是是 Google]
这个链接有两个问题,它要么下载一个带有中文字符的 .csv 文件(我相信它已损坏?),要么下载一些 HTML(如下所示)。当 HTML 另存为 HTML 文件并运行时,它会将我带到 Google Trends 主页,其中包含看似无用的 URL:
https://www.google.com/trends/#geo=US&date=now+7-d&cmpt=q&q=debt&hl=en-US&content=1
<html><head><title>Redirecting</title>
<script type="text/javascript" language="javascript">
// Accessing window.external members can cause IE to throw exceptions.
// Any code that acesses window.external members must be try/catch wrapped
/** @preserveTry */
try {
if (top == self) {
if (window.gtbExternal) {
window.gtbExternal.setM();
} else {
window.external.setM();
}
}
}
catch(err) {
}
</script>
<meta http-equiv="refresh" content="0; url='http://www.google.com/trends#geo=US&date=now+7-d&cmpt=q&q=debt&hl=en-US&content=1'">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000cc" vlink="#551a8b" alink="#ff0000"><script type="text/javascript" language="javascript">
location.replace("http://www.google.com/trends#geo\x3dUS\x26date\x3dnow+7-d\x26cmpt\x3dq\x26q\x3ddebt\x26hl\x3den-US\x26content\x3d1")
</script></body></html>
此外,这是我用来下载.csv文件的代码,基本的WebClient
下载方法,字符串url
可以用上面的URL代替.
public static void Download(string url)
{
WebClient webClient = new WebClient();
webClient.DownloadFile(url, @"C:\Users\Sean\Desktop\StockAp\StockApp\StockApp\report.csv");
}
注意:我知道 WebClient
从页面下载 HTML,如果有一种方法可以操作 URL 来获取 HTML 中的数据,那当然会容易得多。但是,据我所知,以某种方式获取 CSV 会好得多。
最佳答案
对于那些在未来关注这个的人,这里是我如何找到一种从谷歌趋势术语中获取/收集数据的方法。
我开始使用一种方法,该方法根据 2 个要求(查询和句点)从头开始创建不同的 URL。 Query 是搜索词,period 是你想要的过去的时间长度(限于 last hrs,last 4 hrs,last 24 hrs,last week)。对于那些想知道我是如何找到新 URL 的人,请阅读这篇文章(http://techslides.com/hacking-the-google-trends-api)。它包含大量与收集 Google 趋势数据的多种方式相关的信息。
这是 URL 构建器方法的代码:
public static string Build(string query, int period)
{
string url;
string start = "http://www.google.com/trends/fetchComponent?hl=en-US&q=";
string geo = "&geo=US";
string end = "&cid=TIMESERIES_GRAPH_0&export=5&w=500&h=300";
string sPeriod = "";
if (period == (1 / 24))
{
sPeriod = "&date=now 1-H";
}
else if (period == (4 / 24))
{
sPeriod = "&date=now 4-H";
}
else if (period == 1)
{
sPeriod = "&date=now 1-d";
}
else if (period == 7)
{
sPeriod = "&date=now 7-d";
}
else {
Console.WriteLine("URL.Build Error: period is not equal to presets");
}
url = start + query + geo + sPeriod + end;
return url;
}
其次,我使用 WebClient 获取创建的 URL 并从所述 URL 下载 HTML,并通过基本的 WebClient 代码将其存储到 .txt 文件中,另一种方法如下所示:
public static void Download(string url)
{
WebClient webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials;
webClient.DownloadFile(url, @"C:\Users\Sean\Desktop\StockApp\StockApp\StockApp\report.txt");
}
此代码提供了一个文本文件,其中包含一行 HTML,用于创建在之前创建的 URL 中看到的图表 (https://www.google.com/trends/fetchComponent?hl=en-US&q=debt&geo=US&date=now%207-d&cid=TIMESERIES_GRAPH_0&export=5&w=500&h=300) 这是巨大行文本:
var chartData = {"columns":[{"id":"d","label":"Date","type":"datetime"},{"role":"annotation","type":"string"},{"p":{"html":true},"role":"annotationText","type":"string"},{"id":"q0","label":"debt","type":"number"},{"role":"annotation","type":"string"},{"p":{"html":true},"role":"annotationText","type":"string"},{"role":"certainty","type":"boolean"}],"headlineDataPoints":[],"width":485,"axisAnnotations":[],"rows":[[{"v":new Date(2016, 10, 14, 20, 30),"f":"Nov 14, 2016, 20:30 GMT"},null,null,73,null,null,true],[{"v":new Date(2016, 10, 14, 21, 30),"f":"Nov 14, 2016, 21:30 GMT"},null,null,70,null,null,true],[{"v":new Date(2016, 10, 14, 22, 30),"f":"Nov 14, 2016, 22:30 GMT"},null,null,70,null,null,true],[{"v":new Date(2016, 10, 14, 23, 30),"f":"Nov 14, 2016, 23:30 GMT"},null,null,63,null,null,true],[{"v":new Date(2016, 10, 15, 0, 30),"f":"Nov 15, 2016, 00:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 15, 1, 30),"f":"Nov 15, 2016, 01:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 15, 2, 30),"f":"Nov 15, 2016, 02:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 15, 3, 30),"f":"Nov 15, 2016, 03:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 15, 4, 30),"f":"Nov 15, 2016, 04:30 GMT"},null,null,68,null,null,true],[{"v":new Date(2016, 10, 15, 5, 30),"f":"Nov 15, 2016, 05:30 GMT"},null,null,75,null,null,true],[{"v":new Date(2016, 10, 15, 6, 30),"f":"Nov 15, 2016, 06:30 GMT"},null,null,69,null,null,true],[{"v":new Date(2016, 10, 15, 7, 30),"f":"Nov 15, 2016, 07:30 GMT"},null,null,66,null,null,true],[{"v":new Date(2016, 10, 15, 8, 30),"f":"Nov 15, 2016, 08:30 GMT"},null,null,69,null,null,true],[{"v":new Date(2016, 10, 15, 9, 30),"f":"Nov 15, 2016, 09:30 GMT"},null,null,79,null,null,true],[{"v":new Date(2016, 10, 15, 10, 30),"f":"Nov 15, 2016, 10:30 GMT"},null,null,75,null,null,true],[{"v":new Date(2016, 10, 15, 11, 30),"f":"Nov 15, 2016, 11:30 GMT"},null,null,54,null,null,true],[{"v":new Date(2016, 10, 15, 12, 30),"f":"Nov 15, 2016, 12:30 GMT"},null,null,55,null,null,true],[{"v":new Date(2016, 10, 15, 13, 30),"f":"Nov 15, 2016, 13:30 GMT"},null,null,63,null,null,true],[{"v":new Date(2016, 10, 15, 14, 30),"f":"Nov 15, 2016, 14:30 GMT"},null,null,70,null,null,true],[{"v":new Date(2016, 10, 15, 15, 30),"f":"Nov 15, 2016, 15:30 GMT"},null,null,75,null,null,true],[{"v":new Date(2016, 10, 15, 16, 30),"f":"Nov 15, 2016, 16:30 GMT"},null,null,77,null,null,true],[{"v":new Date(2016, 10, 15, 17, 30),"f":"Nov 15, 2016, 17:30 GMT"},null,null,75,null,null,true],[{"v":new Date(2016, 10, 15, 18, 30),"f":"Nov 15, 2016, 18:30 GMT"},null,null,75,null,null,true],[{"v":new Date(2016, 10, 15, 19, 30),"f":"Nov 15, 2016, 19:30 GMT"},null,null,73,null,null,true],[{"v":new Date(2016, 10, 15, 20, 30),"f":"Nov 15, 2016, 20:30 GMT"},null,null,71,null,null,true],[{"v":new Date(2016, 10, 15, 21, 30),"f":"Nov 15, 2016, 21:30 GMT"},null,null,68,null,null,true],[{"v":new Date(2016, 10, 15, 22, 30),"f":"Nov 15, 2016, 22:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 15, 23, 30),"f":"Nov 15, 2016, 23:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 16, 0, 30),"f":"Nov 16, 2016, 00:30 GMT"},null,null,63,null,null,true],[{"v":new Date(2016, 10, 16, 1, 30),"f":"Nov 16, 2016, 01:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 16, 2, 30),"f":"Nov 16, 2016, 02:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 16, 3, 30),"f":"Nov 16, 2016, 03:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 16, 4, 30),"f":"Nov 16, 2016, 04:30 GMT"},null,null,66,null,null,true],[{"v":new Date(2016, 10, 16, 5, 30),"f":"Nov 16, 2016, 05:30 GMT"},null,null,63,null,null,true],[{"v":new Date(2016, 10, 16, 6, 30),"f":"Nov 16, 2016, 06:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 16, 7, 30),"f":"Nov 16, 2016, 07:30 GMT"},null,null,75,null,null,true],[{"v":new Date(2016, 10, 16, 8, 30),"f":"Nov 16, 2016, 08:30 GMT"},null,null,82,null,null,true],[{"v":new Date(2016, 10, 16, 9, 30),"f":"Nov 16, 2016, 09:30 GMT"},null,null,93,null,null,true],[{"v":new Date(2016, 10, 16, 10, 30),"f":"Nov 16, 2016, 10:30 GMT"},null,null,73,null,null,true],[{"v":new Date(2016, 10, 16, 11, 30),"f":"Nov 16, 2016, 11:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 16, 12, 30),"f":"Nov 16, 2016, 12:30 GMT"},null,null,58,null,null,true],[{"v":new Date(2016, 10, 16, 13, 30),"f":"Nov 16, 2016, 13:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 16, 14, 30),"f":"Nov 16, 2016, 14:30 GMT"},null,null,70,null,null,true],[{"v":new Date(2016, 10, 16, 15, 30),"f":"Nov 16, 2016, 15:30 GMT"},null,null,71,null,null,true],[{"v":new Date(2016, 10, 16, 16, 30),"f":"Nov 16, 2016, 16:30 GMT"},null,null,73,null,null,true],[{"v":new Date(2016, 10, 16, 17, 30),"f":"Nov 16, 2016, 17:30 GMT"},null,null,73,null,null,true],[{"v":new Date(2016, 10, 16, 18, 30),"f":"Nov 16, 2016, 18:30 GMT"},null,null,71,null,null,true],[{"v":new Date(2016, 10, 16, 19, 30),"f":"Nov 16, 2016, 19:30 GMT"},null,null,72,null,null,true],[{"v":new Date(2016, 10, 16, 20, 30),"f":"Nov 16, 2016, 20:30 GMT"},null,null,70,null,null,true],[{"v":new Date(2016, 10, 16, 21, 30),"f":"Nov 16, 2016, 21:30 GMT"},null,null,67,null,null,true],[{"v":new Date(2016, 10, 16, 22, 30),"f":"Nov 16, 2016, 22:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 16, 23, 30),"f":"Nov 16, 2016, 23:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 17, 0, 30),"f":"Nov 17, 2016, 00:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 17, 1, 30),"f":"Nov 17, 2016, 01:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 17, 2, 30),"f":"Nov 17, 2016, 02:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 17, 3, 30),"f":"Nov 17, 2016, 03:30 GMT"},null,null,58,null,null,true],[{"v":new Date(2016, 10, 17, 4, 30),"f":"Nov 17, 2016, 04:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 17, 5, 30),"f":"Nov 17, 2016, 05:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 17, 6, 30),"f":"Nov 17, 2016, 06:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 17, 7, 30),"f":"Nov 17, 2016, 07:30 GMT"},null,null,70,null,null,true],[{"v":new Date(2016, 10, 17, 8, 30),"f":"Nov 17, 2016, 08:30 GMT"},null,null,73,null,null,true],[{"v":new Date(2016, 10, 17, 9, 30),"f":"Nov 17, 2016, 09:30 GMT"},null,null,72,null,null,true],[{"v":new Date(2016, 10, 17, 10, 30),"f":"Nov 17, 2016, 10:30 GMT"},null,null,66,null,null,true],[{"v":new Date(2016, 10, 17, 11, 30),"f":"Nov 17, 2016, 11:30 GMT"},null,null,58,null,null,true],[{"v":new Date(2016, 10, 17, 12, 30),"f":"Nov 17, 2016, 12:30 GMT"},null,null,48,null,null,true],[{"v":new Date(2016, 10, 17, 13, 30),"f":"Nov 17, 2016, 13:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 17, 14, 30),"f":"Nov 17, 2016, 14:30 GMT"},null,null,66,null,null,true],[{"v":new Date(2016, 10, 17, 15, 30),"f":"Nov 17, 2016, 15:30 GMT"},null,null,67,null,null,true],[{"v":new Date(2016, 10, 17, 16, 30),"f":"Nov 17, 2016, 16:30 GMT"},null,null,69,null,null,true],[{"v":new Date(2016, 10, 17, 17, 30),"f":"Nov 17, 2016, 17:30 GMT"},null,null,68,null,null,true],[{"v":new Date(2016, 10, 17, 18, 30),"f":"Nov 17, 2016, 18:30 GMT"},null,null,68,null,null,true],[{"v":new Date(2016, 10, 17, 19, 30),"f":"Nov 17, 2016, 19:30 GMT"},null,null,66,null,null,true],[{"v":new Date(2016, 10, 17, 20, 30),"f":"Nov 17, 2016, 20:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 17, 21, 30),"f":"Nov 17, 2016, 21:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 17, 22, 30),"f":"Nov 17, 2016, 22:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 17, 23, 30),"f":"Nov 17, 2016, 23:30 GMT"},null,null,55,null,null,true],[{"v":new Date(2016, 10, 18, 0, 30),"f":"Nov 18, 2016, 00:30 GMT"},null,null,51,null,null,true],[{"v":new Date(2016, 10, 18, 1, 30),"f":"Nov 18, 2016, 01:30 GMT"},null,null,52,null,null,true],[{"v":new Date(2016, 10, 18, 2, 30),"f":"Nov 18, 2016, 02:30 GMT"},null,null,50,null,null,true],[{"v":new Date(2016, 10, 18, 3, 30),"f":"Nov 18, 2016, 03:30 GMT"},null,null,51,null,null,true],[{"v":new Date(2016, 10, 18, 4, 30),"f":"Nov 18, 2016, 04:30 GMT"},null,null,56,null,null,true],[{"v":new Date(2016, 10, 18, 5, 30),"f":"Nov 18, 2016, 05:30 GMT"},null,null,58,null,null,true],[{"v":new Date(2016, 10, 18, 6, 30),"f":"Nov 18, 2016, 06:30 GMT"},null,null,56,null,null,true],[{"v":new Date(2016, 10, 18, 7, 30),"f":"Nov 18, 2016, 07:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 18, 8, 30),"f":"Nov 18, 2016, 08:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 18, 9, 30),"f":"Nov 18, 2016, 09:30 GMT"},null,null,71,null,null,true],[{"v":new Date(2016, 10, 18, 10, 30),"f":"Nov 18, 2016, 10:30 GMT"},null,null,65,null,null,true],[{"v":new Date(2016, 10, 18, 11, 30),"f":"Nov 18, 2016, 11:30 GMT"},null,null,51,null,null,true],[{"v":new Date(2016, 10, 18, 12, 30),"f":"Nov 18, 2016, 12:30 GMT"},null,null,51,null,null,true],[{"v":new Date(2016, 10, 18, 13, 30),"f":"Nov 18, 2016, 13:30 GMT"},null,null,57,null,null,true],[{"v":new Date(2016, 10, 18, 14, 30),"f":"Nov 18, 2016, 14:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 18, 15, 30),"f":"Nov 18, 2016, 15:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 18, 16, 30),"f":"Nov 18, 2016, 16:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 18, 17, 30),"f":"Nov 18, 2016, 17:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 18, 18, 30),"f":"Nov 18, 2016, 18:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 18, 19, 30),"f":"Nov 18, 2016, 19:30 GMT"},null,null,58,null,null,true],[{"v":new Date(2016, 10, 18, 20, 30),"f":"Nov 18, 2016, 20:30 GMT"},null,null,54,null,null,true],[{"v":new Date(2016, 10, 18, 21, 30),"f":"Nov 18, 2016, 21:30 GMT"},null,null,51,null,null,true],[{"v":new Date(2016, 10, 18, 22, 30),"f":"Nov 18, 2016, 22:30 GMT"},null,null,46,null,null,true],[{"v":new Date(2016, 10, 18, 23, 30),"f":"Nov 18, 2016, 23:30 GMT"},null,null,42,null,null,true],[{"v":new Date(2016, 10, 19, 0, 30),"f":"Nov 19, 2016, 00:30 GMT"},null,null,40,null,null,true],[{"v":new Date(2016, 10, 19, 1, 30),"f":"Nov 19, 2016, 01:30 GMT"},null,null,39,null,null,true],[{"v":new Date(2016, 10, 19, 2, 30),"f":"Nov 19, 2016, 02:30 GMT"},null,null,39,null,null,true],[{"v":new Date(2016, 10, 19, 3, 30),"f":"Nov 19, 2016, 03:30 GMT"},null,null,42,null,null,true],[{"v":new Date(2016, 10, 19, 4, 30),"f":"Nov 19, 2016, 04:30 GMT"},null,null,45,null,null,true],[{"v":new Date(2016, 10, 19, 5, 30),"f":"Nov 19, 2016, 05:30 GMT"},null,null,45,null,null,true],[{"v":new Date(2016, 10, 19, 6, 30),"f":"Nov 19, 2016, 06:30 GMT"},null,null,47,null,null,true],[{"v":new Date(2016, 10, 19, 7, 30),"f":"Nov 19, 2016, 07:30 GMT"},null,null,51,null,null,true],[{"v":new Date(2016, 10, 19, 8, 30),"f":"Nov 19, 2016, 08:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 19, 9, 30),"f":"Nov 19, 2016, 09:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 19, 10, 30),"f":"Nov 19, 2016, 10:30 GMT"},null,null,57,null,null,true],[{"v":new Date(2016, 10, 19, 11, 30),"f":"Nov 19, 2016, 11:30 GMT"},null,null,50,null,null,true],[{"v":new Date(2016, 10, 19, 12, 30),"f":"Nov 19, 2016, 12:30 GMT"},null,null,39,null,null,true],[{"v":new Date(2016, 10, 19, 13, 30),"f":"Nov 19, 2016, 13:30 GMT"},null,null,41,null,null,true],[{"v":new Date(2016, 10, 19, 14, 30),"f":"Nov 19, 2016, 14:30 GMT"},null,null,38,null,null,true],[{"v":new Date(2016, 10, 19, 15, 30),"f":"Nov 19, 2016, 15:30 GMT"},null,null,39,null,null,true],[{"v":new Date(2016, 10, 19, 16, 30),"f":"Nov 19, 2016, 16:30 GMT"},null,null,39,null,null,true],[{"v":new Date(2016, 10, 19, 17, 30),"f":"Nov 19, 2016, 17:30 GMT"},null,null,37,null,null,true],[{"v":new Date(2016, 10, 19, 18, 30),"f":"Nov 19, 2016, 18:30 GMT"},null,null,40,null,null,true],[{"v":new Date(2016, 10, 19, 19, 30),"f":"Nov 19, 2016, 19:30 GMT"},null,null,38,null,null,true],[{"v":new Date(2016, 10, 19, 20, 30),"f":"Nov 19, 2016, 20:30 GMT"},null,null,36,null,null,true],[{"v":new Date(2016, 10, 19, 21, 30),"f":"Nov 19, 2016, 21:30 GMT"},null,null,36,null,null,true],[{"v":new Date(2016, 10, 19, 22, 30),"f":"Nov 19, 2016, 22:30 GMT"},null,null,36,null,null,true],[{"v":new Date(2016, 10, 19, 23, 30),"f":"Nov 19, 2016, 23:30 GMT"},null,null,34,null,null,true],[{"v":new Date(2016, 10, 20, 0, 30),"f":"Nov 20, 2016, 00:30 GMT"},null,null,33,null,null,true],[{"v":new Date(2016, 10, 20, 1, 30),"f":"Nov 20, 2016, 01:30 GMT"},null,null,33,null,null,true],[{"v":new Date(2016, 10, 20, 2, 30),"f":"Nov 20, 2016, 02:30 GMT"},null,null,37,null,null,true],[{"v":new Date(2016, 10, 20, 3, 30),"f":"Nov 20, 2016, 03:30 GMT"},null,null,35,null,null,true],[{"v":new Date(2016, 10, 20, 4, 30),"f":"Nov 20, 2016, 04:30 GMT"},null,null,39,null,null,true],[{"v":new Date(2016, 10, 20, 5, 30),"f":"Nov 20, 2016, 05:30 GMT"},null,null,41,null,null,true],[{"v":new Date(2016, 10, 20, 6, 30),"f":"Nov 20, 2016, 06:30 GMT"},null,null,45,null,null,true],[{"v":new Date(2016, 10, 20, 7, 30),"f":"Nov 20, 2016, 07:30 GMT"},null,null,43,null,null,true],[{"v":new Date(2016, 10, 20, 8, 30),"f":"Nov 20, 2016, 08:30 GMT"},null,null,54,null,null,true],[{"v":new Date(2016, 10, 20, 9, 30),"f":"Nov 20, 2016, 09:30 GMT"},null,null,48,null,null,true],[{"v":new Date(2016, 10, 20, 10, 30),"f":"Nov 20, 2016, 10:30 GMT"},null,null,56,null,null,true],[{"v":new Date(2016, 10, 20, 11, 30),"f":"Nov 20, 2016, 11:30 GMT"},null,null,71,null,null,true],[{"v":new Date(2016, 10, 20, 12, 30),"f":"Nov 20, 2016, 12:30 GMT"},null,null,61,null,null,true],[{"v":new Date(2016, 10, 20, 13, 30),"f":"Nov 20, 2016, 13:30 GMT"},null,null,44,null,null,true],[{"v":new Date(2016, 10, 20, 14, 30),"f":"Nov 20, 2016, 14:30 GMT"},null,null,40,null,null,true],[{"v":new Date(2016, 10, 20, 15, 30),"f":"Nov 20, 2016, 15:30 GMT"},null,null,42,null,null,true],[{"v":new Date(2016, 10, 20, 16, 30),"f":"Nov 20, 2016, 16:30 GMT"},null,null,42,null,null,true],[{"v":new Date(2016, 10, 20, 17, 30),"f":"Nov 20, 2016, 17:30 GMT"},null,null,41,null,null,true],[{"v":new Date(2016, 10, 20, 18, 30),"f":"Nov 20, 2016, 18:30 GMT"},null,null,40,null,null,true],[{"v":new Date(2016, 10, 20, 19, 30),"f":"Nov 20, 2016, 19:30 GMT"},null,null,44,null,null,true],[{"v":new Date(2016, 10, 20, 20, 30),"f":"Nov 20, 2016, 20:30 GMT"},null,null,43,null,null,true],[{"v":new Date(2016, 10, 20, 21, 30),"f":"Nov 20, 2016, 21:30 GMT"},null,null,43,null,null,true],[{"v":new Date(2016, 10, 20, 22, 30),"f":"Nov 20, 2016, 22:30 GMT"},null,null,41,null,null,true],[{"v":new Date(2016, 10, 20, 23, 30),"f":"Nov 20, 2016, 23:30 GMT"},null,null,43,null,null,true],[{"v":new Date(2016, 10, 21, 0, 30),"f":"Nov 21, 2016, 00:30 GMT"},null,null,48,null,null,true],[{"v":new Date(2016, 10, 21, 1, 30),"f":"Nov 21, 2016, 01:30 GMT"},null,null,47,null,null,true],[{"v":new Date(2016, 10, 21, 2, 30),"f":"Nov 21, 2016, 02:30 GMT"},null,null,48,null,null,true],[{"v":new Date(2016, 10, 21, 3, 30),"f":"Nov 21, 2016, 03:30 GMT"},null,null,52,null,null,true],[{"v":new Date(2016, 10, 21, 4, 30),"f":"Nov 21, 2016, 04:30 GMT"},null,null,53,null,null,true],[{"v":new Date(2016, 10, 21, 5, 30),"f":"Nov 21, 2016, 05:30 GMT"},null,null,57,null,null,true],[{"v":new Date(2016, 10, 21, 6, 30),"f":"Nov 21, 2016, 06:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 21, 7, 30),"f":"Nov 21, 2016, 07:30 GMT"},null,null,64,null,null,true],[{"v":new Date(2016, 10, 21, 8, 30),"f":"Nov 21, 2016, 08:30 GMT"},null,null,83,null,null,true],[{"v":new Date(2016, 10, 21, 9, 30),"f":"Nov 21, 2016, 09:30 GMT"},null,null,100,null,null,true],[{"v":new Date(2016, 10, 21, 10, 30),"f":"Nov 21, 2016, 10:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 21, 11, 30),"f":"Nov 21, 2016, 11:30 GMT"},null,null,49,null,null,true],[{"v":new Date(2016, 10, 21, 12, 30),"f":"Nov 21, 2016, 12:30 GMT"},null,null,49,null,null,true],[{"v":new Date(2016, 10, 21, 13, 30),"f":"Nov 21, 2016, 13:30 GMT"},null,null,55,null,null,true],[{"v":new Date(2016, 10, 21, 14, 30),"f":"Nov 21, 2016, 14:30 GMT"},null,null,59,null,null,true],[{"v":new Date(2016, 10, 21, 15, 30),"f":"Nov 21, 2016, 15:30 GMT"},null,null,60,null,null,true],[{"v":new Date(2016, 10, 21, 16, 30),"f":"Nov 21, 2016, 16:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 21, 17, 30),"f":"Nov 21, 2016, 17:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 21, 18, 30),"f":"Nov 21, 2016, 18:30 GMT"},null,null,62,null,null,true],[{"v":new Date(2016, 10, 21, 19, 30),"f":"Nov 21, 2016, 19:30 GMT (partial data)"},null,null,60,null,null,true]],"showHeadlines":false,"percentData":false,"colors":["#3f85f2"],"height":230}; var htmlChart = new trends.HtmlChart( 'time-chart', chartData.columns, chartData.rows, chartData.headlineDataPoints, null , chartData.showHeadlines,true, chartData.percentData, chartData.colors, chartData.width, chartData.height, chartData.axisAnnotations,true);htmlChart.render();
使用 HTML 的这一行,我减少了不必要的信息,留下了搜索的日期和值,然后我可以在我的程序中使用它们。
关于c# - 从 Google Trends 下载 .csv 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40647404/
#include using namespace std; class C{ private: int value; public: C(){ value = 0;
这个问题已经有答案了: What is the difference between char a[] = ?string?; and char *p = ?string?;? (8 个回答) 已关闭
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 7 年前。 此帖子已于 8 个月
除了调试之外,是否有任何针对 c、c++ 或 c# 的测试工具,其工作原理类似于将独立函数复制粘贴到某个文本框,然后在其他文本框中输入参数? 最佳答案 也许您会考虑单元测试。我推荐你谷歌测试和谷歌模拟
我想在第二台显示器中移动一个窗口 (HWND)。问题是我尝试了很多方法,例如将分辨率加倍或输入负值,但它永远无法将窗口放在我的第二台显示器上。 关于如何在 C/C++/c# 中执行此操作的任何线索 最
我正在寻找 C/C++/C## 中不同类型 DES 的现有实现。我的运行平台是Windows XP/Vista/7。 我正在尝试编写一个 C# 程序,它将使用 DES 算法进行加密和解密。我需要一些实
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
有没有办法强制将另一个 窗口置于顶部? 不是应用程序的窗口,而是另一个已经在系统上运行的窗口。 (Windows, C/C++/C#) 最佳答案 SetWindowPos(that_window_ha
假设您可以在 C/C++ 或 Csharp 之间做出选择,并且您打算在 Windows 和 Linux 服务器上运行同一服务器的多个实例,那么构建套接字服务器应用程序的最明智选择是什么? 最佳答案 如
你们能告诉我它们之间的区别吗? 顺便问一下,有什么叫C++库或C库的吗? 最佳答案 C++ 标准库 和 C 标准库 是 C++ 和 C 标准定义的库,提供给 C++ 和 C 程序使用。那是那些词的共同
下面的测试代码,我将输出信息放在注释中。我使用的是 gcc 4.8.5 和 Centos 7.2。 #include #include class C { public:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我的客户将使用名为 annoucement 的结构/类与客户通信。我想我会用 C++ 编写服务器。会有很多不同的类继承annoucement。我的问题是通过网络将这些类发送给客户端 我想也许我应该使用
我在 C# 中有以下函数: public Matrix ConcatDescriptors(IList> descriptors) { int cols = descriptors[0].Co
我有一个项目要编写一个函数来对某些数据执行某些操作。我可以用 C/C++ 编写代码,但我不想与雇主共享该函数的代码。相反,我只想让他有权在他自己的代码中调用该函数。是否可以?我想到了这两种方法 - 在
我使用的是编写糟糕的第 3 方 (C/C++) Api。我从托管代码(C++/CLI)中使用它。有时会出现“访问冲突错误”。这使整个应用程序崩溃。我知道我无法处理这些错误[如果指针访问非法内存位置等,
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一些 C 代码,将使用 P/Invoke 从 C# 调用。我正在尝试为这个 C 函数定义一个 C# 等效项。 SomeData* DoSomething(); struct SomeData {
这个问题已经有答案了: Why are these constructs using pre and post-increment undefined behavior? (14 个回答) 已关闭 6
我是一名优秀的程序员,十分优秀!