`
C#
int X = 200; int Y = 900; mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, X * 65536 / 1680, Y * 65536 / 1080, 0, 0); mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN, X * 65536 / 1680, Y * 65536 / 1080, 0, 0); mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTUP, X * 65536 / 1680, Y * 65536 / 1080, 0, 0); StreamReader sr = new StreamReader("script.js", Encoding.UTF8); string js = sr.ReadToEnd(); sr.Close(); for (int i = 1; i < 100; i++) { string url = string.Format("window.location.href = 'https://www.zhihu.com/people/su-qing-hua-94/following?page={0}';", i); input(url); Thread.Sleep(5000); input(js); Thread.Sleep(1000); } } private static void input(string s) { Clipboard.SetText(s); System.Windows.Forms.SendKeys.SendWait("^{v}"); Thread.Sleep(200); System.Windows.Forms.SendKeys.SendWait("{ENTER}"); }
以下是JS ///这里要增加jquery的脚本
function User() { } var users = new Array(); var id_objs = $('.UserLink-link'); var num_objs = $('.ContentItem-statusItem'); for (i = 0; i < 20; i++) { var user = new User(); user.id = $(id_objs[i * 2 + 1]).attr('href').split('/')[2] user.answer = $(num_objs[i * 3]).text().split(' ')[0] user.topic = $(num_objs[i * 3 + 1]).text().split(' ')[0] user.follow = $(num_objs[i * 3 + 2]).text().split(' ')[0] users.push(user) } //alert(users); for (i = 0; i < 20; i++) { if (users[i].follow < 500) { var url = 'https://www.zhihu.com/api/v4/members/' + users[i].id + '/followers' alert(url) $.ajax({ url: url, type: 'DELETE' }); } }
`