Python请求从浏览器重新构建cookie信息

时间:2016-02-03 23:59:56

标签: python cookies python-requests

我必须使用我的cookie信息发出http请求,因为当前的Web应用程序没有公开api来获取数据。

MCHALLENGE = CHALLENGE_DONE; ipServerp_grandslam2e_80 = 82712748.20480.0000; __ca = P0-361438119-1454365384599; s_getNewRepeat = 1454365384951-新; s_lv = 1454365384953; s_vnum = 1456808400955%26vn%3D1; s_cc = TRUE; s_fid = 24C5BAE937778C2F-2319CF2297558C5F; s_sq =%5B%5BB%5D%5D; MSESSION = nrtLGo9j + 11CNQliPTsj3GnXW7YGEl7RmO2DZLHF6EvgoerYioMu162 ++ fUVZFKRuXo8ntcJdwEg7qijbLecxyKDxN4QWUUPppPXnF + WP + JcDsJG6djuQ2DkOUOUOzPvP9pU4ZXEiWRDJsH8Vlk2Zg442aE2eyyJ0fV7K02cweLbKF0D / sDBu919tc6 + 0Y4TjV0yxCDeyFuk + if2TNworWjaMass6HIQvGGWx2kNPf7jPe + dRjfdK + 6DDtdWQNawgloC4bt5EEte5a2mkzY6O6 + vC5pjEHjnT3EFAtxLsabQExX2Ab7hcjUz / tXkqqRwJh2X2cvtpD8utpDobniyfhToxfg ++ eblfy0QzgTvwefgJGqAcrcxyKEf6btl3mjzpT / qtElFiJCo0SvN3cai5 / VF6 + / + 7DZD89aEV0uEvQp95IUcSuDlSTbfoTjt6sX9h2D + jHr2tDGcXueSrN029c2JQZ7v9CLFXbecHtdrSKWfM6MYLv7QsjKFIUmCT0prmdOZmZ + rTWFiUKXRGNC2BA6kR4165UjeY0BQXa6XOrfmMJux9LaUKIym4OvlltH 5S + 5KQPtzvjP96mBVWqdNPZokReQY5QxZ3ztGR / tyh4 + fnLTQyXhRBH / jLmqNdZoCwhRFJfHj9qqgi3J0dcKAIMiGj06XrrqeN4zF / kQ2qCw7c1UL9DQ70qHP65ggM4FgfKkX0WHLJrwandi9K8iYavGE4YkENfLb0CFXOtFN1ekdBlaikAdez2WEs / TMjY1Ei9x9pYI7ht + 3exUb0wWhIgwVv1myWAhkUGPIL1PS7mi + A6tWMPpidl4zlTAvY / YJdZJOQW7gD7uI + AAz4ucm3A7VBdtfOe / PRlylHg9 + xOJjIqmVKa1e4zzM / yvOSpYu9AL8Qkxe4Bvn7GHq + 94ZXG8rC + 4410 / + DLNS 16dDoOBI6G / nOBjavVe3X + qgcvvFi8K8GDp / xdBXz9eUDEzPcrRuU28y7cc KPmvakmRPwutjQDdNA0iP8KoJtrVrpih9EP5P1l + NpNJHnLn / CW9RSsDJuMLfMuelaEO7eVL + q91t3HG0pebZ / utYMyHxLI1fCEpXDdYC8IBObaNCJylFRL80l59GviefcYdfMQjSWemhVvEBelGl77zNx + 7FdZs / wtLVCOxaDaif2TdW6LO5hvTIHeXOsdKtMykitBXYXtecZJbyLHW3kBGDiOT2qDyhiWIIWspvQZaNHuj9PSzWPIq7 / tDTxdQ4 + qskd + LDWGcB2LinFt0j / LOpsTjZRZ80RaVQloFAigaMJkp8Q3VPFJksbkMofBcYmC8dFlSQCW65pn4fypsLDb5HibroD0pshQeaaid1AZ8iVZlwdBMlk27LGU8TtGhfEAwtNeQbA32knTSixq3jAIq / + + ysZ1 + PITN + GzmtLFjqBMBANfiFWQAQiYIjaED6c3wHtkzoBVAx3MYrb + keNIeNc1 + 744cfNx wTTwAzelKvhVT3CgECccXze1UKbUQZ; JSESSIONID = zjPJWyLMspYZgQz02B42FnDv3QCPv1v57wLR768kCrrd48Dtm21F -223451482!; CTICookie = a9a17649-55b7-475a-81df-06f715b50695 =真安培; 1eb9e01a-2ff7-405b-B319-ae2b839ecee8 =真安培; f4052f95-9686-4aac-a959-50e6a2e2b8dd = TRUE; SiteminderUserInfo = SiteminderUserId = P7C&安培; SiteminderUserGUID = 45ec3b6f-6378-480c-8c5b-2be29cbbc9fd; DRUM_BT1 = R:43 | I:7917 | E:529; DRUM_BT = R:43 | G:aecc35e8-9ce2-4f21-8957-944f5bd4334e

这是传递的cookie字符串。

如何使用Python字典重建相同的信息,以便使用python请求模块传递。

1 个答案:

答案 0 :(得分:0)

data = dict(s.split("=") for s in my_cookie_string.split(";"))

我想......也许?