0

我正在尝试使用以下方法自动访问“ http://games.espn.go.com/fba/clubhouse?leagueId=xxxxx&teamId=8&seasonId=2014 ”:

$ebay_user_id = "username"; 
$ebay_user_password = "password"; 
$cookie_file_path = "crawler\ebay_login\cook";

$LOGINURL = "http://games.espn.go.com/fba/signin";
$POSTFIELDS = 'e=0&cookieDomain=.go.com&multipleDomains=true&username='. $ebay_user_id .'&password='. $ebay_user_password;

$reffer = "http://games.espn.go.com/fba/signin?redir=http%3A%2F%2Fgames.espn.go.com%2Ffba%2Fclubhouse%3FteamId%3D8%26leagueId%xxxxxx%26seasonId%3D2014"; 

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $reffer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
$result = curl_exec ($ch);
curl_close ($ch);

我正在使用一个为 ebay 工作的示例。我应该把重点放在哪里才能为 espn 工作?在我的示例中,它被重定向到显示“无效登录。请重试”的页面。

4

0 回答 0