9 lines of JavaScript code to get QQ group members specific implementation _javascript skills

Source: Internet
Author: User
Yesterday saw a micro-blog: "22 line of JavaScript code to achieve the QQ group member extractor. The spirit of curiosity to click in, found no effect, one is the QQ version upgrade, the second is the code inside the blog is also a bit cumbersome.

So I try to write a, calculate above 9 lines, though small, spite.
Copy Code code as follows:

var ids = Document.queryselectorall (". member_id");
var names = Document.queryselectorall (". Member_name");
var output = "", length = ids.length;

for (var i=0; i<length; i++) {
Output + + ids[i].innerhtml.slice (1,-1) + ":" + names[i].innerhtml + "\ n";
}
Console.log (output);


How to use

Advanced such as QQ group space, directly into the can point this link: http://qun.qzone.qq.com, if you want to get group information, first you must be a group member.

After logging in, the top menu has "my group" and selects a group in the secondary menu. Click on "group members" again.

Press F12, bring up the developer tools, and select the JavaScript console. (If you use Chrome, you can just press Ctrl + Shift + J).

Put that piece of code in here, enter!
Copy Code code as follows:

var ids = Document.queryselectorall (". member_id");
var names = Document.queryselectorall (". Member_name");
var output = "", length = ids.length;

for (var i=0; i<length; i++) {
Output + + ids[i].innerhtml.slice (1,-1) + ":" + names[i].innerhtml + "\ n";
}
Console.log (output);

If it feels too troublesome to copy to copy, I made a bookmark.

Drag the link below to the Bookmarks bar: Get QQ Group members

Then you can go into the group Address Book--> Ctrl + Shift + J--> Click on the tab bar--> copy.

Note: This code is only for study and research use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.