Session
| s = requests.Session() |
| |
| r = s.post('http://work.hortune.tw:9988/login', data = {"username": "hortune"}) |
| print(r.text) |
| |
| |
| r = s.get('http://work.hortune.tw:9988') |
| print(r.text) |
| |
不會被偽造ㄇ?
- 會r
- e.g.
- 你的user id是 666666
- 那server回你的token
- (666666*10000 + 1234)^123123123
- 6610983105
- 1234跟123123123是server自己保護的東西,user不會知道
情境
- 你有自己的token,想偽造他人的token?
- False
- 因為沒有123123123這個key跟1234這個nonce
- 詳情去看密碼相關用書
Stage1 如何按按鈕?
- 按鈕其實只是Post Request
- /stage1
- /stage1_easy
Stage2 如何Search Text
- 觀察,對網頁parse
- /stage2
- /stage2_easy
Stage3 Parsing
- Stage2 變形而已
- /stage3
- /stage3_easy
Stage4 Iter-button
- 手動parsing看看?
.split()
?
- /stage4
- /stage4_easy
Deeper
- 如果網頁有動畫要怎麼爬呢?
- e.g. Infinite scroll
- 用selenium之類的東西去實際模擬
- 把所有request仔細看一看
之芽搶票 誤上賊船
{"metaMigratedAt":"2023-06-14T16:08:41.983Z","metaMigratedFrom":"YAML","title":"Sprout Challenge","breaks":true,"slideOptions":"{\"theme\":\"solarized\",\"transition\":\"fade\"}","contributors":"[]"}