作者sariel0322 (sariel)
看板Python
標題[問題] python抓網頁資料問題
時間Tue Dec 23 21:40:26 2014
不好意思又來發問,而且這次不知道算不算純python問題
想請問一下,我用beautifulsoup來抓取網頁資料
想要抓的是這個網頁按下"perform"的資料
原本的網址:
http://web.expasy.org/cgi-bin/peptide_mass/peptide-mass.pl?P35225
按下後會跑出這一類的資料
http://ppt.cc/xTj1
但是這些資料的網址卻變成:
http://web.expasy.org/cgi-bin/peptide_mass/peptide-mass.pl
用beautifulsoup抓的時候就變成錯誤了,用這網址當然也不能用
想請問一下,我該怎麼抓附圖的資料
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 120.126.36.171
※ 文章網址: http://www.ptt.cc/bbs/Python/M.1419342031.A.27C.html
推 Seudo: requests.post(url,data={'protein':'P35225'}).text 12/23 23:28
→ Thisisnotptt: 你試試看行不行,有用到mechanize套件 12/23 23:56
→ Thisisnotptt: 送出相對應的POST他就會給你對的資料了 12/23 23:58
→ sariel0322: 好像不行...一樓可以讀,但是重要的table的資料出不來 12/30 23:36
推 Seudo: form都填完就會有table資料了 12/31 17:49