scrapy ajax的問題 財富值77

科技 未結 1 1204
奇怪君6666
奇怪君6666 2022-08-22 10:51

我正在爬一個asp.net的網(wǎng)頁,其中有一個以post方法提交表單的ajax,我通過模擬post表單發(fā)現(xiàn),響應的內(nèi)容和用瀏覽器的響應文本不一樣
這是通過模擬post得到的文本

0|hiddenField|__EVENTTARGET||0|hiddenField|__EVENTARGUMENT||0|hiddenField|__LASTFOCUS||1204|hiddenField|__VIEWSTATE|/wEPDwUIMTI1NjYzOTMPZBYCAgMPZBYMAgUPEGQQFQUM6K+36YCJ5oupLi4uBueUsue6pwbkuZnnuqcG5LiZ57qnBuS4gee6pxUFAAExATIBMwE0FCsDBWdnZ2dnZGQCCQ8QFgYeDURhdGFUZXh0RmllbGQFCEFyZWFOYW1lHg5EYXRhVmFsdWVGaWVsZAUCSUQeC18hRGF0YUJvdW5kZxAVAg0tLeivt+mAieaLqS0tCeW5v+S4nOecgRUCAAQyMTQ2FCsDAmdnZGQCCw8QZGQUKwEBZmQCDQ8QZGQUKwEBZmQCFQ9kFgJmD2QWBAIBDxYCHgtfIUl0ZW1Db3VudAIBFgJmD2QWAmYPFQcBMRLlub/kuJznnIHmuIXov5zluIIDNTExATMq5bm/5Lic55yB5pyJ6Imy6YeR5bGe5Zyw6LSo5bGA5Lmd5Zub4peL6ZifBuS4mee6pwnmnY7mm7TlsJRkAgMPZBYEAgEPFgYeBWNsYXNzBQ5NZXNzYWdlQmFySW5mbx4JaW5uZXJodG1sBRjor7fpgInmi6nmn6Xor6LmnaHku7bvvIEeB1Zpc2libGVoZAIDDxYCHgVzdHlsZQW0AWRpc3BsYXk6bm9uZTttYXJnaW46IDVweCAwcHggMHB4IDBweDtwYWRkaW5nOjNweCAwcHggMHB4IDBweDt3aWR0aDoxMDAlO3doaXRlLXNwYWNlOm5vd3JhcDtvdmVyZmxvdzpoaWRkZW47Ym9yZGVyLXRvcDojMDAwMDAwIDFweCBzb2xpZDtib3JkZXItYm90dG9tOiMwMDAwMDAgMXB4IHNvbGlkO2hlaWdodDozMHB4OxYCZg9kFgRmDxYCHwcFDWRpc3BsYXk6bm9uZTsWAgIBDxBkZBYBAgFkAgEPFgIfBwUNZGlzcGxheTpub25lOxYCAgEPDxYGHg5DdXN0b21JbmZvVGV4dGUeCFBhZ2VTaXplAg8eC1JlY29yZGNvdW50AgFkZAIXD2QWAmYPZBYCAgMPZBYEAgEPFgQfBAUOTWVzc2FnZUJhckluZm8fBQUY6K+36YCJ5oup5p+l6K+i5p2h5Lu277yBZAIDD2QWAmYPZBYEZg8WAh8HBQ1kaXNwbGF5Om5vbmU7FgICAQ8QZGQWAQIBZAIBD2QWAgIBDw8WAh8IZWRkZE7/qFJ/lZUXHG/3+KW81s12taYs|300|hiddenField|__EVENTVALIDATION|/wEWIgL66/n1DwLTvNCHCQLd/pb/DALSkbwRAtORvBEC0JG8EQLRkbwRArPa2IkIAvPV8OEHArPflNsEAq6b7dwBAvW/o+IHAsWd9e4KAsHXwpEEAqmkwZANAqbLq/0BAqbLl/0BAqTLq/0BAqLLq/0BAoCKzKoGAsjsgfcEAoG75PEDAtmO7KMFAp7F97oNAqbT3oYIAqm8tOsEAqm8iOsEAqu8tOsEAq28tOsEAo/907wDAuWroYgGAvq1h7kMAtDqo+sLAoX62sAGRfPLI+SQuFVqoE9J4Gr5FRTO0CU=|19|asyncPostBackControlIDs||BtnSearch,BtnAnnual|0|postBackControlIDs|||27|updatePanelIDs||tUpdatePanel5,tUpdatePanel1|0|childUpdatePanelIDs|||0|panelsToRefreshIDs|||2|asyncPostBackTimeout||90|26|formAction||QueryList.aspx?Areald=2147|4|pageTitle||在線查詢|

這是我用抓包工具抓到的響應包的返回數(shù)據(jù)部分截圖

發(fā)現(xiàn)通過模擬獲得的文本是抓到的包的最后一行,而我想要的是除了最后一行的內(nèi)容
幫我看看為什么,謝謝了

這是我模擬post的代碼

1條回答
  •  v呼呼斤斤計較
    2022-08-22 11:46

    這個東西,只能具體網(wǎng)頁具體分析,不過如果參數(shù)那么多,如果不是特別追求效率的話,還是用Phantomjs + selenium 吧

    0 討論(0)
提交回復