折腾:
【记录】Mac中用Python去模拟百度登陆
期间,写代码模拟登录之前,需要先去用Chrome调试出逻辑才行。
目前看到是:
1. Request URL: https://passport.baidu.com/v2/api/?login 2. Request Method: POST 3. Status Code: 200 OK 4. Remote Address: 180.97.36.39:443 5. Referrer Policy: unsafe-url 1. Access-Control-Expose-Headers: Trace-ID 2. Cache-Control: public 3. Connection: keep-alive 4. Content-Encoding: gzip 5. Content-Type: text/html 6. Date: Wed, 14 Nov 2018 12:53:50 GMT 7. Expires: 0 8. Last-Modified: Wed, 14 Nov 2018 12:53:50 12NovGMT 9. P3p: CP=" OTI DSP COR IVA OUR IND COM " 10. Pragma: public 11. Server: Apache 12. Set-Cookie: STOKEN=06e98bba1ef0f7ab334e18c0b88e53981bcce7a23582d3f89baeb7a8403f7384; expires=Sun, 31-Jan-2027 12:53:50 GMT; path=/; domain=passport.baidu.com; secure; httponly 13. Set-Cookie: USERNAMETYPE=3; expires=Sun, 31-Jan-2027 12:53:50 GMT; path=/; domain=passport.baidu.com; httponly 14. Set-Cookie: SAVEUSERID=832ac310eafdec37ba218f0a39db5d; expires=Sun, 31-Jan-2027 12:53:50 GMT; path=/; domain=passport.baidu.com; httponly 15. Set-Cookie: BDUSS=IwMTRUbG1-WWJOdHk2NnU3dX5-dk9PVGNKUWtsS3Vrc3JzWmFicm82SGVweE5jQVFBQUFBJCQAAAAAAAAAAAEAAAClmDXpY3JpZmFuMjAxOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN4a7FveGuxbLX; expires=Sun, 31-Jan-2027 12:53:50 GMT; path=/; domain=baidu.com; httponly 16. Set-Cookie: PTOKEN=25da2e916f2ee549a5dacc46ba122aa0; expires=Sun, 31-Jan-2027 12:53:50 GMT; path=/; domain=passport.baidu.com; secure; httponly 17. Set-Cookie: HISTORY=62f53d6d3ca37d3d9afceaec613ba4cdec0dfd7d74f4c1a39171050f8010b32257; expires=Sun, 31-Jan-2027 12:53:50 GMT; path=/; domain=passport.baidu.com; httponly 18. Strict-Transport-Security: max-age=31536000 19. Trace-Id: 20. Tracecode: 32304395090753648394111420 21. Tracecode: 32304395090908054282111420 22. Transfer-Encoding: chunked 23. Vary: Accept-Encoding 1. Request Header sview source 1. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 2. Accept-Encoding: gzip, deflate, br 3. Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 4. Cache-Control: no-cache 5. Connection: keep-alive 6. Content-Length: 1369 7. Content-Type: application/x-www-form-urlencoded 8. Cookie: HOSUPPORT=1; SAVEUSERID=832ac310eafdec37ba218f0a39db5d; HISTORY=62f53d6d3ca37d3d9afceaec613ba4cdec0dfd7d74f4c1a39171050f8010b32257; USERNAMETYPE=3; BAIDUID=041D3965370A5B4B08872FAFED1861EC:FG=1; PSTM=1542200014; delPer=0; H_PS_PSSID=1440_21079_27508; BIDUPSID=6720BF4EAED8C8448EB6540DAF83BE56; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; UBI=fi_PncwhpxZ%7ETaCBmCzQLZjs4M5VfoUkjTds%7Ee1jE4TCSaORNyoSIz0aDQi-47oWFMIYGQpfwtLhc6W9JFuvglGY6VORPphqEpop2Dy%7Ev1FLvjK0OTxPynrDw%7Ef44kQDxVY2of7E-oGU38F1xd5AXiySPmCHnDhYmU7vRdBC9fUcDEc5xnsLl6qJqr2e-soiId1L1DEH0BglzkiaXIeXKEVhBj%7E7C88bvohhA__ 9. Host: passport.baidu.com 10. Origin: https://www.baidu.com 11. Pragma: no-cache 12. Referer: https://www.baidu.com/ 13. Upgrade-Insecure-Requests: 1 14. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 2. Query String Parametersview sourceview URL encoded 1. login: 3. Form Dataview sourceview URL encoded 1. staticpage: https://www.baidu.com/cache/user/html/v3Jump.html 2. charset: UTF-8 3. token: 90bc10213433cd4c98315dae992f4606 4. tpl: mn 5. subpro: 6. apiver: v3 7. tt: 1542200030401 8. codestring: 9. safeflg: 0 10. u: https://www.baidu.com/ 11. isPhone: false 12. detect: 1 13. gid: 7307568-0B9B-4D82-BBD8-841B85583C28 14. quick_user: 0 15. logintype: dialogLogin 16. logLoginType: pc_loginDialog 17. idc: 18. loginmerge: true 19. splogin: rate 20. username: xxx 21. password: BLVuEw/RtRdrAWGOwWbgidEd+GTksStYEB1By1D0wwphxEWXif2cveNedAYo4/w0KN4x6bvqXyfARCbra87+H8eruEUqUmkHSmWz5kEinFRgkCkcc4+2aHAkka7NTvChvSiLvJVXjt2o4gGSHu5BD5r7AWSroqipKwl9sZvzkzk= 22. mem_pass: on 23. rsakey: 41sJFG3RcOoahnaW7pz3MQafvlmYRPUV 24. crypttype: 12 25. ppui_logintime: 11800 26. countrycode: 27. fp_uid: 28. fp_info: 29. loginversion: v4 30. dv: tk0.0030021777560813591542200018839@YYs0-CCi0QBmZE8Ej5E14CKwy8EwhHB6hHKNhJRNCNGNo1tkViCOCFCiBQBmZE8Ej5E14CKwy8EwhHB6hHKNhJRNCNGNo1tkVwr6TFCiRQBmZE8Ej5E14CKwy8EwhHB6hHKNhJRNCNGNo1tkVYBOTFCOEQBmZE8Ej5E14CKwy8EwhHB6hHKNhJRNCNGNo1tkVjr6hFCi1QBmZE8Ej5E14CKwy8EwhHB6hHKNhJRNCNGNo1tk1~C6vFis0VrCiVNtk7xBm~zrkV~t5~lB6qQBiRjtkElCiRQHk0zBL~ZCkqQB6qwCOBQv24ruwoh6vyHE4C8Ki2~Kwy3GNoUHq__CrrPErzAghWGhzsjBz~ztkR~FspSpQ~tOq~Biq~BO2NCiRwCOqYB6Bwr62wCk7zBkq~B6VYBi1_jsaP5uxR5BatzyNSNRD034X95ED0lyUtzZwG3uT93TD9I8_yspBOBQBm~ZBOBZtk2wrA~ZBOV~tkV~Bm~ZBOEztk2zCk0QCiRN 31. traceid: 7F9B8701 32. callback: parent.bd__pcbs__tizd99
所以一点点研究参数从哪里来
先去看看
password: BLVuEw/RtRdrAWGOwWbgidEd+GTksStYEB1By1D0wwphxEWXif2cveNedAYo4/w0KN4x6bvqXyfARCbra87+H8eruEUqUmkHSmWz5kEinFRgkCkcc4+2aHAkka7NTvChvSiLvJVXjt2o4gGSHu5BD5r7AWSroqipKwl9sZvzkzk=
结果搜不到这些字符串
-》就没法发继续模拟登陆了。。。
百度模拟登陆 password 如何计算
转载请注明:在路上 » 【未解决】用Chrome调试网页中百度账号登录的逻辑