京东自动入会获取京豆

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
Python script to automate the change of desktop background

wallomator Python script to automate the change of desktop background A python script that automates the process of changing the desktop background. I

Mohammed Haaris Javed 10 Jun 16, 2022
XHacks 2021 Startup Track Winner: Be Heard. Educate, Enact, Empower. No voice left behind. (backend)

Be Heard: X Hacks 2021 Submission Educate, Enact, Empower. No voice left behind. Inspiration To say 2020 was an eventful year would be an understateme

3 Jul 14, 2022
An improved version of the common ˙pacman -S˙

BetterPacmanLook An improved version of the common pacman -S. Installation I know that this is probably one of the worst solutions and i will be worki

1 Nov 06, 2021
Script em python, utilizando PySimpleGUI, para a geração de arquivo txt a ser importado no sistema de Bilhetagem Eletrônica da RioCard, no Estado do Rio de Janeiro.

pedido-vt-riocard Script em python, utilizando PySimpleGUI, para a geração de arquivo txt a ser importado no sistema de Bilhetagem Eletrônica da RioCa

Carlos Bruno Gomes 1 Dec 01, 2021
*考研学习利器,玩电脑控制不住自己时,可以使用该程序定日期锁屏,同时有精美壁纸锁屏显示,也不会枯燥。

LockscreenbyTime_win10 A python program in win10. You can set the time to lock the computer(by setting year, month, day), Fullscreen pictures will sho

PixianDouban 4 Jul 10, 2022
Bring A Trailer(BAT) is a popular online auction website for enthusiast cars. This traverse auction results and saves them as CSV

BaT Data Grabber Bring A Trailer(BAT) is a popular online auction website for enthusiast cars. This traverse auction results and saves them as CSV Bri

Elliot Weil 2 Oct 31, 2021
Python for downloading model data (HRRR, RAP, GFS, NBM, etc.) from NOMADS, NOAA's Big Data Program partners (Amazon, Google, Microsoft), and the University of Utah Pando Archive System.

Python for downloading model data (HRRR, RAP, GFS, NBM, etc.) from NOMADS, NOAA's Big Data Program partners (Amazon, Google, Microsoft), and the University of Utah Pando Archive System.

Brian Blaylock 194 Jan 02, 2023
Tools I'm building in order to help my investments decisions

b3-tools Tools I'm building in order to help my investments decisions. Based in the REITs I've in my personal portifolio I ran a script that scrapy th

Rafael Cassau 2 Jan 21, 2022
BridgeWalk is a partially-observed reinforcement learning environment with dynamics of varying stochasticity.

BridgeWalk is a partially-observed reinforcement learning environment with dynamics of varying stochasticity. The player needs to walk along a bridge to reach a goal location. When the player walks o

Danijar Hafner 6 Jun 13, 2022
Tindicators is a Python library to calculate the values of various technical indicators

Tindicators is a Python library to calculate the values of various technical indicators

omar 3 Mar 03, 2022
Desenvolvendo as habilidades básicas de programação visando a construção de aplicativos por meio de bibliotecas apropriadas à Ciência de Dados.

Algoritmos e Introdução à Computação Ementa: Conceitos básicos sobre algoritmos e métodos para sua construção. Tipos de dados e variáveis. Estruturas

Dyanna Cruz 1 Jan 06, 2022
This is a pretty basic but relatively nice looking Python Pomodoro Timer.

Python Pomodoro-Timer This is a pretty basic but relatively nice looking Pomodoro Timer. Currently its set to a very basic mode, but the funcationalit

EmmHarris 2 Oct 18, 2021
Funchacks - Fun module which is a small set of utilities

funchacks 👋 Introduction Funchacks is a fun module that provides a small packag

DenyS 6 Aug 04, 2022
Python script to commit to your github for a perfect commit streak. This is purely for education purposes, please don't use this script to do bad stuff.

Daily-Git-Commit Commit to repo every day for the perfect commit streak Requirments pip install -r requirements.txt Setup Download this repository. Cr

JareBear 34 Dec 14, 2022
Meaningful and minimalist release notes for developers

Managing manual release notes is hard. Therefore, everyone tends to generate release notes from commit messages. But, you won't get a meaningful release note at the end.

codezri 31 Dec 30, 2022
hey, this repo is the backend of the sociio project

sociio backend Hey, this repository is a part of sociio project , In this repo we are working to create an independent server for everything you can i

2 Jun 09, 2022
Encode and decode cancro lang files to and from brainfuck

cancrolang Encode and decode cancro lang files to and from brainfuck. examples python3 main.py -f hello.cancro --run Hello World! the interpreter is n

witer33 1 Dec 20, 2021
List of resources for learning Category Theory

A curated list of resources for studying category theory. As resources aimed at mathematicians are abundant, this list is aimed at materials whose target audience is not people with a graduate-level

Bruno Gavranović 100 Jan 01, 2023
A tool to help calculate how to split conveyors in Satisfactory into specific ratios.

Satisfactory Splitter Calculator A tool to help calculate how to split conveyors in Satisfactory into specific ratios. Dependencies Python 3.9 PyYAML

RobotiCat 5 Dec 22, 2022
Extremely unfinished animation toolset for Blender 3.

AbraTools Alpha IMPORTANT: Code is a mess. Be careful using it in production. Bug reports, feature requests and PRs are appreciated. Download AbraTool

Abra 15 Dec 17, 2022