京东自动入会获取京豆

Overview

京东入会领京豆

要求

  1. 有一定的电脑知识 or 有耐心爱折腾
  2. 需要Chrome(推荐)Edge(Chromium)Firefox
  3. 操作系统需是Mac(本人没在m1上测试)Linux(在deepin上测试过)Windows

安装方法

脚本采用Selenium遍历京东入会有礼界面,由于遍历了20000+个店铺,可能所需要的时间比较长(视电脑情况30min-5h)

  1. 克隆到本地

    git clone https://github.com/AntonVanke/JDBrandMember.git
  2. 安装所需要的包

    pip3 install -r requirements.txt
  3. 下载对应的浏览器驱动放到项目的drivers文件夹下面

    1. chrome请访问chrome://version/查看浏览器的版本,然后去ChromeDriver Mirror (taobao.org)下载对应的版本/系统驱动
    2. edge请访问edge://version/查看浏览器的版本,Microsoft Edge - Webdriver (windows.net)下载
    3. Firefox请访问Releases · mozilla/geckodriver (github.com)下载
  4. 配置config.json

    {
        "thread": 6,  # 线程数, 推荐4-8线程
        "browserType": "Chrome",  # Chrome/Edge/Firefox
        "headless": true,  # 无头模式 请保持开启否则多线程情况下窗口比较多
        "binary": "",  # 可执行路径,如果驱动没有找到浏览器的话需要你手动配置
        "useUser": 0,  # 用户下标,默认是0(users[0]第一个用户)
        "users": []  # 用户列表可以通过 add_cookie.py 添加
    }
  5. 添加cookie

    请在项目目录下执行python3 add_cookie.py, 在打开的浏览器界面登录你的京东,此时你可以看到config.json已经有了你的用户信息(请不要随意泄露你的cookie

  6. 执行主程序

    在项目目录下执行python3 main.py,等待执行完毕即可,你可以访问项目下的logs/jdbm.log查看你的日志

LICENSE

MIT License

Copyright (c) 2021 Vanke Anton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • 报错:OSError: [WinError 193] %1 不是有效的 Win32 应用程序

    报错:OSError: [WinError 193] %1 不是有效的 Win32 应用程序

    2021-05-21 21:52:18 INFO 结束运行 Traceback (most recent call last): File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 391, in main() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 341, in main add_cookie() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 102, in add_cookie browser = get_browser(False) File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 89, in get_browser return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={}, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

    opened by lanyucomputer 27
  • ubuntu 下无法运行

    ubuntu 下无法运行

    按照攻略执行到 python3 main.py后产生报错 Traceback (most recent call last): File "/root/jd/ht/main.py", line 1, in import ctypes File "/usr/local/python3/lib/python3.9/ctypes/init.py", line 8, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes'

    已经按照百度安装了libffi-devel python3 版本--Python 3.9.4 请问大神有解决的方法吗

    opened by winsonhet 12
  • termux终端可否实现跑脚本?

    termux终端可否实现跑脚本?

    大神,你好

        想尝试在termux上跑这个脚本,但失败了,可能是没有安装或者说没有正确识别google driver有关。错误如下:
    

    运行python3 main.py

    Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'drivers/chromedriver'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 254, in browser = getBrowser(headless=False) File "/data/data/com.termux/files/home/JDBrandMember/main.py", line 224, in getBrowser _browser = webdriver.Chrome(executable_path="drivers/chromedriver", options=chrome_options) File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

      因不便用电脑,想问下,有没有可能在终端里跑这个脚本,谢谢!
    
    opened by biewenwoshishui021 6
  • 为什么会报错,用提3.8和3.95版64位的,难道要用32位的PYTHON吗?我等下用32位试下,不行再来反馈

    为什么会报错,用提3.8和3.95版64位的,难道要用32位的PYTHON吗?我等下用32位试下,不行再来反馈

    2021-05-21 21:33:22 INFO 结束运行 Traceback (most recent call last): File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 391, in main() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 341, in main add_cookie() File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 102, in add_cookie browser = get_browser(False) File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 89, in get_browser return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={}, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Yang\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

    opened by lanyucomputer 3
  • 大佬能不能看一下这是什么问题

    大佬能不能看一下这是什么问题

    File "E:\JD\main.py", line 89, in get_browser return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={}, File "D:\python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init RemoteWebDriver.init( File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "D:\python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "D:\python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

    opened by RPZ1211 3
  • 运行出错

    运行出错

    运行出现以下错误,求教大佬如何解决,使用的平台是win10,Google Chrome 版本 90.0.4430.72(正式版本) (64 位),用的最新版京东入会有礼刷京豆0.3(附打包程序) DevTools listening on ws://127.0.0.1:9254/devtools/browser/88214b30-de5f-4a44-be75-3ad51055359f [14228:9528:0420/041210.575:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -101 [14228:9528:0420/041210.684:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -101 2021-04-20 04:12:15 INFO 登录成功 用户名:京豆数: [14772:7852:0420/041216.733:ERROR:device_event_log_impl.cc(214)] [04:12:16.734] Bluetooth: bluetooth_adapter_winrt.cc:1072 Getting Default Adapter failed. [15200:14480:0420/041404.804:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is disabled

    opened by bbilyvm 3
Releases(v21.05.31)
  • v21.05.31(May 31, 2021)

  • v21.05.30(May 30, 2021)

  • v21.05.15(May 14, 2021)

  • v21.04.30(Apr 30, 2021)

    https://github.com/AntonVanke/JDBrandMember/issues/19#issuecomment-829754120 https://github.com/AntonVanke/JDBrandMember/issues/19#issuecomment-830176294 https://github.com/AntonVanke/JDBrandMember/issues/21#issuecomment-829757868 https://github.com/AntonVanke/JDBrandMember/issues/15


    1. 修改了进度条显示
    2. 更新了 shopid.txt
    3. 修复了去重的方式
    4. 重新遍历了近期(2021年04月30日)入会送京豆的网站

    注意:

    1. config.json包含你的用户信息
    2. 如果关闭程序后CPU占用率依旧很高,请执行stop.bat如果你正在使用浏览器,执行前请保存好你的浏览器内容。
    3. 这是一个测试版本
    4. 其它请查看readme.md

    https://github.com/AntonVanke/JDBrandMember/blob/main/README.md#%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95

    这个项目是我为了练习数据爬取而创建的,可能会有各式各样的错误,如果有什么问题的话欢迎反馈。
    Source code(tar.gz)
    Source code(zip)
    21_04_30_Windows_10_Chrome.zip(16.34 MB)
  • v21.04.24-beta(Apr 24, 2021)

    更新了以下内容

    1. 加快了遍历速度,降低cpu占用率
    2. 独立了添加cookie的程序add_cookie.exe,可以添加多用户(暂时需在config手动选择)
    3. 重新遍历了近期(2021年04月23日)入会送京豆的网站

    使用了Pyinstaller打包了Windows平台的应用程序,解压缩首先运行add_cookie.exe添加用户,再运行main.exe开始。

    默认的Chrome驱动版本是90.0.4430.85,其它版本的Chrome请自行下载;其它版本的浏览器请自行下载驱动并配置config.json

    注意:

    1. config.json包含你的用户信息
    2. 如果关闭程序后CPU占用率依旧很高,请执行stop.bat如果你正在使用浏览器,执行前请保存好你的浏览器内容。
    3. 这是一个测试版本
    4. 其它请查看readme.md
    这个项目是我为了练习数据爬取而创建的,可能会有各式各样的错误,如果有什么问题的话欢迎反馈。
    Source code(tar.gz)
    Source code(zip)
    21_04_24_Windows_10_Chrome.zip(22.01 MB)
  • v21.04.17(Apr 17, 2021)

    更新了以下内容

    • 采用多线程的方式,更快速的遍历(能在一个小时遍历完全)
    • 重新爬取了京东的店铺数据,将50万个店铺精简到25878
    • 重新遍历了近期(2021年04月17日)入会送京豆的网站,存储在url.txt下,以供快速刷分

    另外使用了Pyinstaller打包了三个平台的应用程序,解压缩运行即可

    注意:

    Linux 可能会遇到找不到chrome的情况,需要配置目录

    请在电脑上安装对应版本的Chrome浏览器

    pyinstaller打包的应用程序可能会有各式各样的问题,建议还是直接运行Python代码

    这个项目是我为了练习数据爬取而创建的,可能会有各式各样的错误,因为我是初学者,如果有什么问题的话可以联系我。
    Source code(tar.gz)
    Source code(zip)
    21_04_17_Linux_Chrome.zip(12.25 MB)
    21_04_17_Mac_86_64_Chrome.zip(15.87 MB)
    21_04_17_Windows_10_Chrome.zip(13.15 MB)
  • v21.04.04(Apr 4, 2021)

  • v21.04.02(Apr 2, 2021)

    Source code(tar.gz)
    Source code(zip)
Owner
Vanke Anton
Vanke Anton
Yet another Python Implementation of the Elo rating system.

Python Implementation - Elo Rating System Yet another Python Implementation of the Elo rating system (how innovative am I right?). Only supports 1vs1

Kraktoos 5 Dec 22, 2022
A collection of software that serve no purpose other than waste your time. Forking is encouraged!

the-useless-collection A collection of software that serve no purpose other than waste your time. Forking is encouraged! Requires Python 3.9. Usage Go

Imsad2 1 Mar 16, 2022
Python bindings for the Plex API.

Python-PlexAPI Overview Unofficial Python bindings for the Plex API. Our goal is to match all capabilities of the official Plex Web Client. A few of t

Michael Shepanski 931 Jan 07, 2023
Modelling the 30 salamander problem from `Pure Mathematics` by Martin Liebeck

Salamanders on an island The Problem From A Concise Introduction to Pure Mathematics By Martin Liebeck Critic Ivor Smallbrain is watching the horror m

Faisal Jina 1 Jul 10, 2022
🤡 Multiple Discord selfbot src deobfuscated !

Deobfuscated selfbot sources About. If you whant to add src, please make pull requests. If you whant to deobfuscate src, send mail to

Sreecharan 5 Sep 13, 2021
A hackerank problems, solution repository

This is a repository for all hackerank challenges kindly note this is for learning purposes and if you wish to contribute, dont hesitate all submision

Tyler Mwalo Kenneth's 1 Dec 20, 2021
A Bot Which Can generate Random Account Based On Your Hits.

AccountGenBot This Bot Can Generate Account With Hits You Save (Randomly) Keyfeatures Join To Use Support Limit Account Generation Using Sql Customiza

DevsExpo 30 Oct 21, 2022
Python library to interact with Move Hub / PoweredUp Hubs

Python library to interact with Move Hub / PoweredUp Hubs Move Hub is central controller block of LEGO® Boost Robotics Set. In fact, Move Hub is just

Andrey Pokhilko 499 Jan 04, 2023
Pyhexdmp - Python hex dump module

Pyhexdmp - Python hex dump module

25 Oct 23, 2022
Versión preliminar análisis general de Covid-19 en Colombia

Covid_Colombia_v09 Versión: Python 3.8.8 1/ La base de datos del Ministerio de Salud (Minsalud Colombia) está en https://www.datos.gov.co/Salud-y-Prot

Julián Gómez 1 Jan 30, 2022
Collections of python projects

nppy, mostly contains projects written in Python. Some projects are very simple while some are a bit lenghty and difficult(for beginners) Requirements

ghanteyyy 75 Dec 20, 2022
A project to explore and provide useful code for Mango Markets

🥭 Mango Explorer A project to explore and provide useful code for Mango Markets

Blockworks Foundation 160 Dec 19, 2022
This is an online course where you can learn and master the skill of low-level performance analysis and tuning.

Performance Ninja Class This is an online course where you can learn to find and fix low-level performance issues, for example CPU cache misses and br

Denis Bakhvalov 1.2k Dec 30, 2022
A set of tools for ripping music from Konami mobile games

Konami Mobile Ripping Toolset A set of tools for ripping music from Konami mobile games Contents nigger.py for niggering konami's website, ripping all

5 Oct 20, 2022
AlexaUsingPython - Alexa will pay attention to your order, as: Hello Alexa, play music, Hello Alexa

AlexaUsingPython - Alexa will pay attention to your order, as: Hello Alexa, play music, Hello Alexa, what's the time? Alexa will pay attention to your order, get it, and afterward do some activity as

Abubakar Sattar 10 Aug 18, 2022
Scientific color maps and standardization tools

Scicomap is a package that provides scientific color maps and tools to standardize your favourite color maps if you don't like the built-in ones. Scicomap currently provides sequential, bi-sequential

Thomas Bury 14 Nov 30, 2022
Python library to decode the EU Covid-19 vaccine certificate

DCC Utils Python library to decode the EU Covid-19 vaccine certificate, as specified by the EU. Setup pip install dcc-utils Make sure zbar is installe

Developers Italia 13 Mar 11, 2022
Polypheny Connector for Python

Polypheny Connector for Python This enables Python programs to access Polypheny databases, using an API that is compliant with the Python Database API

Polypheny 3 Jan 03, 2022
Projects and assets from Wireframe #56

Wireframe56 Projects and assets from Wireframe #56 Make a Boulder Dash level editor in Python, pages 50-57, by Mark Vanstone. Code an homage to Bubble

Wireframe magazine 10 Sep 07, 2022
Data repo for one-among.us

Our Data Data repo for one-among.us File Structure Directory /people/userid/: Data for a specific person info.json5: Profile information page.md: Pr

Hykilpikonna 55 Dec 30, 2022