我想用sci-hub.cc下载科学论文,但它是俄语的,不容易使用。它有一个文本字段,用于输入DOI或纸张链接。
现在,我想做一个网站,当用户插入纸质链接时,将此链接作为查询发送到sci-hub,然后下载它。我如何在php中做到这一点?
非常感谢。
发布于 2016-11-19 18:42:30
我不知道你的页面是如何工作的,但你正在寻找的是一个"POST“请求。如果您在页面的字段中键入内容,下面的代码将执行相同的操作:
<php
$url = 'http://sci-hub.cc/';
$data = ['Request'=>'TEXT FOR FIELD'];
$options = array('http' => array(
'method' => 'POST',
'content' => http_build_query($data),
'header'=> "Content-Type: application/x-www-form-urlencoded \r\n")
);
$context = stream_context_create( $options );
$result = file_get_contents( $url, false, $context );
?>
https://stackoverflow.com/questions/40691758
复制相似问题