最近有一个任务,需要通过浏览文章来获取积分,一个个手点文章太麻烦,专业的事情还得专业的来。
法1:模拟发包
抓包发现,是通过接口来使积分增长,那直接模拟发包即可。
至于info_id
的获取,可以通过xpath解析首页页面拿到,也很简单。
import requests
add_browser_integral_url = 'http://lawplatform.unicom.local/law/tpfIntegralDetail/addBrowseIntegralDetail.do'
to_like_url = 'http://lawplatform.unicom.local/law/tpfLike/toLike.do'
user_cookies = 'your_cookies' #此处填上你的ck即可
info_id_list_all = [
"d6a0f28d-c521-4201-9957-be7b80a07e85",
"eb8032e5-391f-4015-84cf-6e146b8273e6",
"8d941714-2320-47cd-a351-0790127fa7f1",
"a250321e-d410-4b9b-907b-4a54a3385e18",
"24a2c877-be2e-4de4-9d74-2a8e22a15a3d",
"9da17aa3-6a7d-4f7e-8db5-f5938c57d0b0",
"47049e2b-578e-463c-81ba-6fc81c0d7108",
"0c2e783c-0120-49de-8792-42788a5b485a",
"cb0e665b-adb2-4cae-99a0-1f76086c9966",
"a61cd520-2cd3-43a6-8003-bed638ef8a1f",
"ffc3ff51-13b0-4582-9f02-d363ea7f49af",
"1429f7a2-c25c-4464-87cf-bc94bbd57d6c",
"a9bc6693-799c-45c5-b035-9281929dc7ac",
"aab79a5a-4e9a-4c34-b1c2-d35708ec5333",
"0ebbb9d9-e972-4ec8-93e8-ea165b7d446c",
"862843d7-3eb0-42c7-86de-e94bb18bd25a",
"d6681468-462b-45f8-84af-8fdf850edd84",
"7c952352-6ae0-41f1-b8a1-fb7aa2de8c1e",
"0af953a1-66f4-477f-88c2-554ac3497f04",
"c8f21dfd-c717-4dc4-b255-52811661a423",
"add5d6d9-f134-4f36-ac0b-1eded145f1d3",
"d1957363-b155-4661-aee6-55adc47e25b9",
"44a74d97-b8da-4d46-8a6f-25dcf8f90619",
"26ff85e6-1911-4f61-b10c-b27d9357b2b2",
"e8f00463-a9c5-4bdb-af97-3b89feab9705",
"5db34e26-6266-4ef8-9dca-05b463a7be15",
"1b725774-6940-480d-89e7-b0e64ac5b0ee",
"3604ff9e-3f08-403c-bc67-2231ece3787b",
"a7f4c238-ecfa-4d07-9b96-51fce4d90ffe",
"c1ad1d18-b82c-463b-975c-fcdbc79b159f",
"0f24b07e-823c-49b5-94b2-4052d9ebfe14",
"a75c64d4-5ab2-47af-b982-99a79fa47c5a",
"9c209541-fc37-42fb-9177-83715df8fd4c",
"dbb4836b-c68f-4e7c-a7ba-baa3fd1ea981",
"bd652aa3-6554-463b-a714-c2340869c657",
"b07649d5-58a3-4de3-8f61-624fe046b6ac",
"bd7cc19f-d363-4d9b-b2de-3344f1913be8",
"14e1b521-a601-491a-9c3c-d180eb5daaa6",
"68fe8644-62c9-4c3e-8660-a11e37c2d136",
"31d644c8-2215-4cc4-ad4c-3d94d39804e0",
"d6a0f28d-c521-4201-9957-be7b80a07e85",
"eb8032e5-391f-4015-84cf-6e146b8273e6",
"5db34e26-6266-4ef8-9dca-05b463a7be15",
"1b725774-6940-480d-89e7-b0e64ac5b0ee",
"14215679-9bc5-42b8-88d2-60fabd361935",
"d553b3e1-e55e-473a-93e3-f177d4a9e5bf",
"cf7ea012-541e-4321-a907-caf6c066d061",
"97959b25-4d4d-46e2-b679-520b20371f59",
"999c3b13-ceff-41b5-81aa-0c6b0e637b59",
"2f60a03a-691b-4179-9914-0fb0213cf890",
"8d941714-2320-47cd-a351-0790127fa7f1",
"a250321e-d410-4b9b-907b-4a54a3385e18",
"a61cd520-2cd3-43a6-8003-bed638ef8a1f",
"1429f7a2-c25c-4464-87cf-bc94bbd57d6c",
"862843d7-3eb0-42c7-86de-e94bb18bd25a",
"d6681468-462b-45f8-84af-8fdf850edd84",
"add5d6d9-f134-4f36-ac0b-1eded145f1d3",
"44a74d97-b8da-4d46-8a6f-25dcf8f90619",
"940d8a5d-2305-40e7-854c-02374d82d507",
"2d406861-535f-4beb-b680-921f4479745c",
"a210ee55-eb33-47b3-9d37-49294e883678",
"ff4dc3da-3358-4344-808f-fa7b9f8d6c92",
"849f4ebb-bc2d-4b24-9217-3543feda5395",
"bdc3b1e4-95f5-4cb9-9735-18414fbce599",
"e2f2067d-c680-477f-be42-548bc9eed7d1",
"660bee87-ab22-4ee4-aca9-9dc49eb20422",
"93049abf-3808-425f-b0e3-fc13e851b58c",
"a55004ea-ef5d-4175-8b39-0be9d46a6acb",
"e4d0fb1a-0759-4fec-8ca2-d8b84acf079b",
"8bc6c38b-b6c9-43c5-a56f-92c54929b85e",
"9da17aa3-6a7d-4f7e-8db5-f5938c57d0b0",
"0c2e783c-0120-49de-8792-42788a5b485a",
"a9bc6693-799c-45c5-b035-9281929dc7ac",
"0ebbb9d9-e972-4ec8-93e8-ea165b7d446c",
"7c952352-6ae0-41f1-b8a1-fb7aa2de8c1e",
"c8f21dfd-c717-4dc4-b255-52811661a423",
"d1957363-b155-4661-aee6-55adc47e25b9",
"e8f00463-a9c5-4bdb-af97-3b89feab9705",
"0bd5ae30-51b6-42b0-be1a-b69792dc0f48",
"124bda7c-1937-44dd-848d-e2280843120d",
"aab79a5a-4e9a-4c34-b1c2-d35708ec5333",
"7907ccd5-5348-4bb6-a98f-6a77dd41fbdb",
"c6e9fbda-967f-4a96-9052-163a34c39964",
"fb112fcd-143d-43ee-9924-19a038366e35",
"1cc64ee5-bff8-4764-9905-c1196a27a800",
"f169c6ba-3032-41ea-8879-f62bdcb0356c",
"7f0d1d8f-9008-4f5d-bfb1-13928bb3836e",
"33f4c853-147d-4261-8054-03d24c16f92d",
"bd000503-c3d3-4240-8651-30abaabd4392",
"23f696c7-cf3d-4324-a58c-e2d9f3b1df65",
"9662362c-27a9-44bf-866c-d939046d448f",
"4f1c21e3-d934-40a7-84aa-4905c14871a2",
"3a46a2fb-00de-4a1a-b94c-9bc85f2bb56d",
"62eb01f1-9b97-40e2-bac2-2ef47e2e23be",
"7b58d38b-0332-406e-add8-6c797f046817",
"8aba30c2-ed56-4234-975d-f3b9904e32a1",
"83f1b19a-b08d-4387-a8d6-0436edb300b7",
"319322a8-695e-4115-a015-91307c3433c3",
"5a2fc2ba-87a3-4ab4-acec-35142b0193c9",
"d79e17b2-5ebd-412f-b390-8816923a019f",
"cb0e665b-adb2-4cae-99a0-1f76086c9966",
"dee88ee4-aead-4742-aa19-57b3ef9c3be1",
"f6593fe0-58cb-4175-90ec-227e6dc8a500",
"eb48900c-9e1b-4e91-8dbb-04b0b89b7211",
"3754085d-2c75-466a-9c44-caa9a0b06c27",
"36f066ea-12bb-4b51-9f16-2815b87f64b1",
"ab4c79a6-3c6c-4842-a2bb-154bb0df78ef",
"630ede40-ec0d-4ad6-aa11-00cfd628852c",
"244ea0f9-ab24-44b3-a04c-dcab803ebd88",
"8d61ad03-817e-48d8-ad73-6431c277a801",
"ffc3ff51-13b0-4582-9f02-d363ea7f49af",
"3604ff9e-3f08-403c-bc67-2231ece3787b",
"d3b09f55-9697-4c68-9de6-2e97a9c9bc79",
"58163297-99a3-4f42-82a9-4115a44bb887",
"480b2bc8-9731-4d5f-b3e5-9cb9b37ad12e",
"85fe3a4b-d33a-436d-9d22-a8b78e2a3492",
"1afabe45-4c6b-4076-adb6-52a4584d5017",
"5590331c-6cb5-4b19-b441-966174e5e22e",
"a28f2ef4-54df-4a4c-9965-d9d5fce96134",
"977beb99-3615-43c5-a199-2977f9bf62fe",
"a7f4c238-ecfa-4d07-9b96-51fce4d90ffe",
"fc667293-92a6-41ea-8615-41c159df4a2e",
"c1ad1d18-b82c-463b-975c-fcdbc79b159f",
"e5a5437c-c4e6-4ae6-994a-0881b54d500a",
"cf0226d0-86e4-4c18-afb7-84aca9a12e1c",
"7fe6cfda-3d20-421e-9cdf-1d633e568df2",
"92230aad-e044-40af-968a-12dcfb820363",
"4c05193f-f800-4da4-9ce2-d92d33a50e0a",
"239dfab1-005c-45c5-b244-99e0c59152af",
"d3fc442c-213a-4086-a875-8050f5712d86",
"ce0ce710-9d62-4b5c-bda6-ff7b3b849f2a",
"19dd2114-db54-4a57-9742-93afa0f955f1",
"85ab4c39-1ebc-41d9-ae15-fc92a99bfdd0",
"7280edc0-d56f-4a9e-a3e7-fabc3847947a",
"bf37578e-4d83-4f9e-8f90-af28a8d762aa",
"ca4389d0-7a23-470c-8b31-7e0f1a6bbd2a",
"18751565-d04e-4e8d-b054-7b34fca75e84",
"89d62c3c-4688-49a3-85c0-c1b65c2547c8",
"20bc4481-1651-4956-88b1-8507c4582022",
"0de29877-7fa6-422c-b932-552b35da4ee2",
"119ce05d-8cf9-47b3-96a7-62e0942b2dbc",
"9becceea-d9e4-41c8-9023-bf4441b8f080",
"2ec98eb5-59e6-4036-b374-db68a57d3504",
"476aa2e4-1c70-4a8d-8e5e-d6f9457a7fe4",
"816f80b4-8d93-40e6-9948-c0d653f1c634",
"48576cb5-5788-450f-b897-2b4f89996d82",
"d47b722b-80d5-449b-b2e1-b1c1ea0a2eea",
"74dc704f-fc98-4d60-aedb-ab1d03e50c38",
"cf79bd74-04d1-409d-ba93-bcd4c4258983",
"b1a7599f-cb0c-479e-baa4-792a554687c2",
"0af953a1-66f4-477f-88c2-554ac3497f04",
"eb81571c-ac0b-4243-8696-7b2f3012925e",
"c68fee1d-a2c7-475d-8fc0-a9f6dad1f261",
"4274056a-5b12-46f8-a8d5-49697d91fadf",
"7a9ef236-e1b5-4a15-be21-24385c754613",
"ab91e25b-bd9a-4ad3-80db-06eac27f4277",
"7fae5f07-4a5c-41a1-8a58-cade51a0b785",
"0d0da4c4-228e-4508-9177-55f0589f2584",
"a98a7628-e25f-4ddd-b698-0cbe7081c259",
"6cf5090d-7b85-4ba1-8804-d8098e99cfc1",
"47049e2b-578e-463c-81ba-6fc81c0d7108",
"4e07b71e-13e1-4963-b953-0bc36e5bd4f8",
"53dcb491-e1de-4089-a3a3-73755d53dfc5",
"b4e5970d-bd65-4b52-b482-7e4f429f907e",
"8c953674-5fd0-48e3-bec3-c3da9309d848",
"5269704e-ec94-4caa-a0c1-59a7212ff6ff",
"8b263fb7-5b11-4941-916d-37ca92b2df6c",
"a29a0015-8ec6-46f5-9a2e-d156272b229a",
"020b5df6-e4dd-4769-bc26-2cfdba64b010",
"81ef9375-7eff-440c-8053-7d650f74ddb0",
"24a2c877-be2e-4de4-9d74-2a8e22a15a3d",
"8c2b8f62-54a1-44db-8a4e-1bb68a6e86bd",
"b3b34618-a785-4961-8a99-ec94c2694fb6",
"9a8dbb80-0bc9-45fd-90b1-2628e9a9e46e",
"19d7f7ba-620e-4712-af2f-dbc026f8f77b",
"f5523c9d-9563-43b4-8fe4-106504a53544",
"6f8f0159-57ac-4ebc-ac39-035e5650a448",
"b7893787-753e-433f-aa28-1443421e83c1",
"7882449c-9604-4366-a9de-f932175df283",
"dccc5a55-237e-425c-9421-0e84aaf64eb1",
"b72590d0-aa88-4057-8589-41b5e43c5089",
"9dc24d76-8e9f-4e80-a872-e40208f2876c",
"a037d336-690a-4557-aab9-1e6d6e2f948f",
"211d70b0-e7d9-4d2f-aef4-1aa2c8ab3055",
"b1f4ba02-0c9b-4540-a7b6-05b80043ef89",
"03c56e47-1d80-4fa8-994d-a8937096309c",
"5f77415e-7da2-48c5-baf6-cef5a625662d",
"8115f1d5-9318-4f49-a050-02351ad00465",
"6812a478-2940-4c42-899c-633c65a8550d",
"26ff85e6-1911-4f61-b10c-b27d9357b2b2",
"8bb6c16d-3a42-4c5e-9c57-f8469b5bfc6b",
"c08ed497-4754-4693-8ae5-367ef85b4bd7",
"e80ef752-eaa0-489b-9610-c393080b2856",
"1afc210f-0db8-4504-ad5f-d1cc02846c35",
"b8c785e9-bd60-40fa-86c8-761fa68c6928",
"26ff85e6-1911-4f61-b10c-b27d9357b2b2",
"8bb6c16d-3a42-4c5e-9c57-f8469b5bfc6b",
"c08ed497-4754-4693-8ae5-367ef85b4bd7",
"e80ef752-eaa0-489b-9610-c393080b2856",
"1afc210f-0db8-4504-ad5f-d1cc02846c35",
"b8c785e9-bd60-40fa-86c8-761fa68c6928",
"26ff85e6-1911-4f61-b10c-b27d9357b2b2",
"8bb6c16d-3a42-4c5e-9c57-f8469b5bfc6b",
"c08ed497-4754-4693-8ae5-367ef85b4bd7",
"e80ef752-eaa0-489b-9610-c393080b2856",
"1afc210f-0db8-4504-ad5f-d1cc02846c35",
"b8c785e9-bd60-40fa-86c8-761fa68c6928",
"26ff85e6-1911-4f61-b10c-b27d9357b2b2",
"8bb6c16d-3a42-4c5e-9c57-f8469b5bfc6b",
"c08ed497-4754-4693-8ae5-367ef85b4bd7",
"e80ef752-eaa0-489b-9610-c393080b2856",
"1afc210f-0db8-4504-ad5f-d1cc02846c35",
"b8c785e9-bd60-40fa-86c8-761fa68c6928",
"26ff85e6-1911-4f61-b10c-b27d9357b2b2",
"8bb6c16d-3a42-4c5e-9c57-f8469b5bfc6b",
"c08ed497-4754-4693-8ae5-367ef85b4bd7",
"e80ef752-eaa0-489b-9610-c393080b2856",
"1afc210f-0db8-4504-ad5f-d1cc02846c35",
"b8c785e9-bd60-40fa-86c8-761fa68c6928"
]
request_header = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
"Connection": "keep-alive",
"Content-Length": "111",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"Cookie": user_cookies,
"Host": "lawplatform.unicom.local",
"Origin": "http://lawplatform.unicom.local",
"Referer": "http://lawplatform.unicom.local/unitework/pf/toMainPage.do",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36",
"X-Requested-With": "XMLHttpRequest"
}
for info_id in info_id_list_all:
params = {
"infoId": info_id,
}
response1 = requests.post(add_browser_integral_url, data=params, headers=request_header)
response2 = requests.post(to_like_url, data=params, headers=request_header)
print(response1.text)
print(response2.text)
法2:前端控制台批量打开文章
原理:通过控制台的功能,定位到页面的文章所在元素,然后对元素添加鼠标点击行为,即可。
具体使用方法:打开更多页面,然后输入代码之前,要现在开发者工具里面点一下文章所在的元素,不然dom定位不到元素,可能是因为dom懒加载?
let rows = window.document.querySelectorAll('.ui-datagrid-cell-special');
console.log(rows)
rows.forEach(row => {
let cells = row.querySelectorAll('.ui-datagrid-inner');
cells.forEach( element => {
let clickableElement = element.querySelector("[onclick]")
console.log(clickableElement)
if (clickableElement) {
let event = new MouseEvent('click', {
bubbles: false,
cancelable: true,
view: window
});
clickableElement.dispatchEvent(event);
}
})
});
法3 逃课-修改网页源码
直接修改前端源代码,想填多少填多少(舞台很大)