[請益] 使用simple_html_dom parsing aspx的網站

看板PHP作者 (raison detre)時間12年前 (2013/07/08 17:16), 編輯推噓2(207)
留言9則, 2人參與, 最新討論串1/5 (看更多)
請問一下 我使用 simple_html_dom 去抓取一個aspx網站的內容 作法如下 $data=array( '__EVENTTARGET'=>'', '__EVENTARGUMENT'=>'', '__LASTFOCUS'=>'', '__VIEWSTATE'=>'', '__EVENTVALIDATION'=>'', ); $data_url = http_build_query($data); $data_len = strlen ($data_url); $request = array( 'http' => array ( 'method' => 'POST', 'content' => $data_url, 'header' => "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Length: " . $data_len . "\r\n" ) ); $context = stream_context_create($request); $html = file_get_html( 'http://www.url.com.tw/history.aspx', false, $context ); 可是以下這幾個欄位 __EVENTTARGET __EVENTARGUMENT __LASTFOCUS __VIEWSTATE __EVENTVALIDATION 不知道要填什麼 因為他是一連串不明的編碼 可是如果保持空白 或是填入與 fiddler中看到相同的值的話 抓到的都是此網頁不存在 請問針對aspx的這種網頁 該如何去parsing -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.85.180.156

07/09 11:08, , 1F
正常方式這頁面是怎麼進去看的?
07/09 11:08, 1F

07/09 12:51, , 2F
由我要抓的上一頁,點一個連結
07/09 12:51, 2F

07/09 12:52, , 3F
然後用post的方式帶一些參數與上述的那些
07/09 12:52, 3F

07/09 12:52, , 4F
其他的參數基本上沒甚麼問題
07/09 12:52, 4F

07/09 12:53, , 5F
可是上述那些如果不帶,還是導不到我要的頁面
07/09 12:53, 5F

07/09 14:18, , 6F
"你要抓的上一頁"->有沒有網址提供一下,想試看看
07/09 14:18, 6F

07/09 15:22, , 8F
威力彩,只想抓固定期數的號碼
07/09 15:22, 8F

07/09 15:23, , 9F
istory.aspx 抱歉,後面斷掉了
07/09 15:23, 9F
文章代碼(AID): #1HseD__r (PHP)
文章代碼(AID): #1HseD__r (PHP)