Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用WGET或Perl下载用PHP/JavaScript内容编码的HTML_Php_Html_Perl_Unix_Wget - Fatal编程技术网

如何使用WGET或Perl下载用PHP/JavaScript内容编码的HTML

如何使用WGET或Perl下载用PHP/JavaScript内容编码的HTML,php,html,perl,unix,wget,Php,Html,Perl,Unix,Wget,我有一个要下载和解析的URL: http://diana.cslab.ece.ntua.gr/micro-CDS/index.php?r=search/results_mature&mir=hsa-miR-3131&kwd=MIMAT0014996 问题是当我使用unixwget以以下方式下载时: $ wget [the above url] 它给了我与我在浏览器上看到的内容不同的内容(也就是说,基因列表不在那里) 编程的正确方法是什么?我刚刚使用PHP进行了测试,它可以很好

我有一个要下载和解析的URL:

http://diana.cslab.ece.ntua.gr/micro-CDS/index.php?r=search/results_mature&mir=hsa-miR-3131&kwd=MIMAT0014996
问题是当我使用unix
wget
以以下方式下载时:

$ wget [the above url]
它给了我与我在浏览器上看到的内容不同的内容(也就是说,基因列表不在那里)


编程的正确方法是什么?

我刚刚使用PHP进行了测试,它可以很好地使用基因列表进行拉动

<?php
echo file_get_contents('http://diana.cslab.ece.ntua.gr/micro-CDS/index.php?r=search/results_mature&mir=hsa-miR-3131&kwd=MIMAT0014996');
?>

你有使用PHP的权限吗

#/usr/bin/perl

use WWW::Mechanize;
use strict;
use warnings;

my $url = "http://diana.cslab.ece.ntua.gr/micro-CDS/index.php?r=search/results_mature&mir=hsa-miR-3131&kwd=MIMAT0014996";

my $mech = WWW::Mechanize->new();
$mech->agent_alias("Windows IE 6");

$mech->get($url);
#now you have access to the HTML code via $mech->content();

要处理HTML代码,我强烈建议
使用HTML::TreeBuilder::XPath
(或其他HTML解析模块)

这对我很有用。你在引用网址吗?“http…996”