1

我正在尝试使用 cURL 以 URL 形式获取数据:

http://example.com/site-explorer/get_overview_text_data.php?data_type=refdomains_stats&hash=19a53c6b9aab3917d8bed5554000c7cb

这需要一个cookie,所以我首先将它存储在一个文件中:

curl -c cookie-jar http://example.com/site-explorer/overview/subdomains/example.com

尝试使用以下值 curl :

curl -b cookie-jar -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" --referer "http://example.com/site-explorer/overview/subdomains/example.com" http://example.com/site-explorer/get_overview_text_data.php?data_type=refdomains_stats&hash=19a53c6b9aab3917d8bed5554000c7cb
4

1 回答 1

1

我突然想到了一个问题:您没有引用 URL,这意味着诸如&and之类的字符?将由 shell 解释,而不是传递给curl. 如果您使用的是完全静态的 URL,请将其括在单引号中,如'http://blah.com/blah/blah...'.

于 2013-03-28T23:39:35.210 回答